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 }} <hr> <h4> {{ company.name }} - {% if user.is_staff and roles.company.change %} + {% if user.is_staff and perms.company.change_company %} <a href="{% url 'admin:company_company_change' company.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a> {% endif %} </h4> <p>{{ company.description }}</p> <div class='btn-group action-buttons'> - {% if company.is_supplier %} + {% if company.is_supplier and roles.purchase_order.add %} <button type='button' class='btn btn-default' id='company-order-2' title='Create purchase order'> <span class='fas fa-shopping-cart'/> </button> {% endif %} + {% if perms.company.change_company %} <button type='button' class='btn btn-default' id='company-edit' title='Edit company information'> <span class='fas fa-edit icon-green'/> </button> + {% endif %} + {% if perms.company.delete_company %} <button type='button' class='btn btn-default' id='company-delete' title='Delete company'> <span class='fas fa-trash-alt icon-red'/> </button> + {% endif %} </div> {% 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 @@ <hr> +{% if roles.purchase_order.change %} <div id='button-toolbar' class='btn-group'> + {% if roles.purchase_order.add %} <button class="btn btn-success" id='part-create' title='{% trans "Create new supplier part" %}'>{% trans "New Supplier Part" %}</button> + {% endif %} <div class="dropdown" style="float: right;"> <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %} <span class="caret"></span></button> <ul class="dropdown-menu"> + {% if roles.purchase_order.add %} <li><a href='#' id='multi-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li> + {% endif %} + {% if roles.purchase_order.delete %} <li><a href='#' id='multi-part-delete' title='{% trans "Delete parts" %}'>{% trans "Delete Parts" %}</a></li> + {% endif %} </ul> </div> </div> +{% endif %} <table class='table table-striped table-condensed' id='part-table' data-toolbar='#button-toolbar'> </table> 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" %} <h3>{{ title }}</h3> <hr> +{% if title == 'Manufacturers' and roles.purchase_order.add or title == 'Suppliers' and roles.purchase_order.add or title == 'Customers' and roles.sales_order.add %} <div id='button-toolbar'> <div class='btn-group'> <button type='button' class="btn btn-success" id='new-company'>{{ button_text }}</button> </div> </div> - +{% endif %} <table class='table table-striped' id='company-table' data-toolbar='#button-toolbar'> </table> 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 @@ <h4>{% trans "Purchase Orders" %}</h4> <hr> +{% if roles.purchase_order.add %} <div id='button-bar'> <div class='button-toolbar container-fluid' style='float: right;'> <button class='btn btn-primary' type='button' id='company-order2' title='{% trans "Create new purchase order" %}'>{% trans "New Purchase Order" %}</button> @@ -17,6 +18,7 @@ </div> </div> </div> +{% endif %} <table class='table table-striped table-condensed po-table' id='purchase-order-table' data-toolbar='#button-bar'> </table> 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 @@ <h4>{% trans "Sales Orders" %}</h4> <hr> +{% if roles.sales_order.add %} <div id='button-bar'> <div class='button-toolbar container-fluid' style='float: right;'> <button class='btn btn-primary' type='button' id='new-sales-order' title='{% trans "Create new sales order" %}'>{% trans "New Sales Order" %}</button> @@ -17,6 +18,7 @@ </div> </div> </div> +{% endif %} <table class='table table-striped table-condensed po-table' id='sales-order-table' data-toolbar='#button-bar'> </table> 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 %} <h3>{% trans "Supplier Part" %}</h3> <p>{{ part.supplier.name }} - {{ part.SKU }}</p> + +{% if roles.purchase_order.change %} <div class='btn-row'> <div class='btn-group action-buttons' role='group'> + {% if roles.purchase_order.add %} <button type='button' class='btn btn-default btn-glyph' id='order-part' title='{% trans "Order part" %}'> <span class='fas fa-shopping-cart'></span> </button> + {% endif %} <button type='button' class='btn btn-default btn-glyph' id='edit-part' title='{% trans "Edit supplier part" %}'> <span class='fas fa-edit icon-green'/> </button> + {% if roles.purchase_order.delete %} <button type='button' class='btn btn-default btn-glyph' id='delete-part' title='{% trans "Delete supplier part" %}'> <span class='fas fa-trash-alt icon-red'/> </button> + {% endif %} </div> </div> +{% 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 @@ <hr> +{% if roles.purchase_order.add %} <div id='button-bar'> <div class='btn-group'> <button class='btn btn-primary' type='button' id='order-part2' title='Order part'>Order Part</button> </div> </div> +{% endif %} <table class='table table-striped table-condensed po-table' id='purchase-order-table' data-toolbar='#button-bar'> </table> 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 @@ <hr> +{% if roles.purchase_order.add %} <div id='price-break-toolbar' class='btn-group'> <button class='btn btn-primary' id='new-price-break' type='button'>{% trans "Add Price Break" %}</button> </div> +{% endif %} <table class='table table-striped table-condensed' id='price-break-table' data-toolbar='#price-break-toolbar'> </table> 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 @@ <h4>{% trans "Sales Order Items" %}</h4> +{% if roles.sales_order.change %} <div id='order-toolbar-buttons' class='btn-group' style='float: right;'> <button type='button' class='btn btn-default' id='new-so-line'>{% trans "Add Line Item" %}</button> </div> +{% endif %} <table class='table table-striped table-condensed' id='so-lines-table' data-toolbar='#order-toolbar-buttons'>