From bae28e82079792d31d110ac20d6b3b3f0f7e4d91 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 10 Nov 2021 23:54:54 +0100 Subject: [PATCH] Add setting for enabeling reports Fixes #2278 --- InvenTree/build/templates/build/build_base.html | 4 ++++ InvenTree/build/templates/build/index.html | 4 ++++ InvenTree/common/models.py | 7 +++++++ InvenTree/order/templates/order/order_base.html | 4 ++++ InvenTree/order/templates/order/purchase_orders.html | 5 ++++- InvenTree/order/templates/order/sales_order_base.html | 4 ++++ InvenTree/order/templates/order/sales_orders.html | 5 ++++- InvenTree/part/templates/part/category.html | 2 ++ InvenTree/part/templates/part/detail.html | 4 ++++ InvenTree/templates/InvenTree/settings/report.html | 1 + InvenTree/templates/base.html | 1 + 11 files changed, 39 insertions(+), 2 deletions(-) diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html index 826baf13ea..22a126fcdf 100644 --- a/InvenTree/build/templates/build/build_base.html +++ b/InvenTree/build/templates/build/build_base.html @@ -34,6 +34,7 @@ src="{% static 'img/blank_image.png' %}" {% include "admin_button.html" with url=url %} {% endif %} +{% if report_enabled %}
+{% endif %} {% if roles.build.change %}
@@ -224,9 +226,11 @@ src="{% static 'img/blank_image.png' %}" {% endif %} }); + {% if report_enabled %} $('#print-build-report').click(function() { printBuildReports([{{ build.pk }}]); }); + {% endif %} $("#build-delete").on('click', function() { launchModalForm( diff --git a/InvenTree/build/templates/build/index.html b/InvenTree/build/templates/build/index.html index ba8997ca05..b2c237c149 100644 --- a/InvenTree/build/templates/build/index.html +++ b/InvenTree/build/templates/build/index.html @@ -27,6 +27,7 @@
+ {% if report_enabled %}
+ {% endif %}
@@ -169,9 +171,11 @@ $("#place-order").click(function() { }); {% endif %} +{% if report_enabled %} $('#print-order-report').click(function() { printPurchaseOrderReports([{{ order.pk }}]); }); +{% endif %} $("#edit-order").click(function() { diff --git a/InvenTree/order/templates/order/purchase_orders.html b/InvenTree/order/templates/order/purchase_orders.html index e15e009927..8ddae982b9 100644 --- a/InvenTree/order/templates/order/purchase_orders.html +++ b/InvenTree/order/templates/order/purchase_orders.html @@ -26,10 +26,11 @@
- + {% if report_enabled %} + {% endif %} @@ -169,6 +170,7 @@ $("#view-list").click(function() { $("#view-calendar").show(); }); +{% if report_enabled %} $("#order-print").click(function() { var rows = $("#purchase-order-table").bootstrapTable('getSelections'); @@ -180,6 +182,7 @@ $("#order-print").click(function() { printPurchaseOrderReports(orders); }) +{% endif %} $("#po-create").click(function() { createPurchaseOrder(); diff --git a/InvenTree/order/templates/order/sales_order_base.html b/InvenTree/order/templates/order/sales_order_base.html index 0f705212db..368c3a2e47 100644 --- a/InvenTree/order/templates/order/sales_order_base.html +++ b/InvenTree/order/templates/order/sales_order_base.html @@ -39,7 +39,9 @@ src="{% static 'img/blank_image.png' %}"