From de65e1631dd0fc4087be2457a6bd7112786e1657 Mon Sep 17 00:00:00 2001 From: eeintech Date: Tue, 20 Oct 2020 14:46:10 -0500 Subject: [PATCH] Updated company templates permissions --- InvenTree/company/templates/company/company_base.html | 8 ++++++-- InvenTree/company/templates/company/detail_part.html | 8 ++++++++ InvenTree/company/templates/company/index.html | 3 ++- InvenTree/company/templates/company/purchase_orders.html | 2 ++ InvenTree/company/templates/company/sales_orders.html | 2 ++ .../company/templates/company/supplier_part_base.html | 8 ++++++++ .../company/templates/company/supplier_part_orders.html | 2 ++ .../company/templates/company/supplier_part_pricing.html | 2 ++ InvenTree/order/templates/order/sales_order_detail.html | 2 ++ 9 files changed, 34 insertions(+), 3 deletions(-) diff --git a/InvenTree/company/templates/company/company_base.html b/InvenTree/company/templates/company/company_base.html index f20107277d..cdca22fa36 100644 --- a/InvenTree/company/templates/company/company_base.html +++ b/InvenTree/company/templates/company/company_base.html @@ -23,23 +23,27 @@ InvenTree | {% trans "Company" %} - {{ company.name }}

{{ company.name }} - {% if user.is_staff and roles.company.change %} + {% if user.is_staff and perms.company.change_company %} {% endif %}

{{ company.description }}

- {% if company.is_supplier %} + {% if company.is_supplier and roles.purchase_order.add %} {% endif %} + {% if perms.company.change_company %} + {% endif %} + {% if perms.company.delete_company %} + {% endif %}
{% endblock %} diff --git a/InvenTree/company/templates/company/detail_part.html b/InvenTree/company/templates/company/detail_part.html index e07304dd13..463bf5814d 100644 --- a/InvenTree/company/templates/company/detail_part.html +++ b/InvenTree/company/templates/company/detail_part.html @@ -9,17 +9,25 @@
+{% if roles.purchase_order.change %}
+ {% if roles.purchase_order.add %} + {% endif %}
+{% endif %}
diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html index 253085568e..c8efbe804b 100644 --- a/InvenTree/company/templates/company/index.html +++ b/InvenTree/company/templates/company/index.html @@ -12,12 +12,13 @@ InvenTree | {% trans "Supplier List" %}

{{ title }}


+{% if title == 'Manufacturers' and roles.purchase_order.add or title == 'Suppliers' and roles.purchase_order.add or title == 'Customers' and roles.sales_order.add %}
- +{% endif %}
diff --git a/InvenTree/company/templates/company/purchase_orders.html b/InvenTree/company/templates/company/purchase_orders.html index bab5cd4bce..a0ef1612fa 100644 --- a/InvenTree/company/templates/company/purchase_orders.html +++ b/InvenTree/company/templates/company/purchase_orders.html @@ -9,6 +9,7 @@

{% trans "Purchase Orders" %}


+{% if roles.purchase_order.add %}
@@ -17,6 +18,7 @@
+{% endif %}
diff --git a/InvenTree/company/templates/company/sales_orders.html b/InvenTree/company/templates/company/sales_orders.html index 0b64bed2f5..03c64d5b88 100644 --- a/InvenTree/company/templates/company/sales_orders.html +++ b/InvenTree/company/templates/company/sales_orders.html @@ -9,6 +9,7 @@

{% trans "Sales Orders" %}


+{% if roles.sales_order.add %}
@@ -17,6 +18,7 @@
+{% endif %}
diff --git a/InvenTree/company/templates/company/supplier_part_base.html b/InvenTree/company/templates/company/supplier_part_base.html index ca09caee93..7476a7c606 100644 --- a/InvenTree/company/templates/company/supplier_part_base.html +++ b/InvenTree/company/templates/company/supplier_part_base.html @@ -18,19 +18,27 @@ src="{% static 'img/blank_image.png' %}" {% block page_data %}

{% trans "Supplier Part" %}

{{ part.supplier.name }} - {{ part.SKU }}

+ +{% if roles.purchase_order.change %}
+ {% if roles.purchase_order.add %} + {% endif %} + {% if roles.purchase_order.delete %} + {% endif %}
+{% endif %} + {% endblock %} {% block page_details %} diff --git a/InvenTree/company/templates/company/supplier_part_orders.html b/InvenTree/company/templates/company/supplier_part_orders.html index 5c2ea6d1d4..29eb8ee874 100644 --- a/InvenTree/company/templates/company/supplier_part_orders.html +++ b/InvenTree/company/templates/company/supplier_part_orders.html @@ -10,11 +10,13 @@
+{% if roles.purchase_order.add %}
+{% endif %}
diff --git a/InvenTree/company/templates/company/supplier_part_pricing.html b/InvenTree/company/templates/company/supplier_part_pricing.html index f9f5063190..97022024f5 100644 --- a/InvenTree/company/templates/company/supplier_part_pricing.html +++ b/InvenTree/company/templates/company/supplier_part_pricing.html @@ -11,9 +11,11 @@
+{% if roles.purchase_order.add %}
+{% endif %}
diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index b6cc761cc7..d21a4e950e 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -13,9 +13,11 @@

{% trans "Sales Order Items" %}

+{% if roles.sales_order.change %}
+{% endif %}