@@ -359,6 +359,7 @@
{% if company.is_customer %}
+ {% if return_order_enabled %}
// Callback function when the 'return orders' panel is loaded
onPanelLoad('return-orders', function() {
@@ -378,6 +379,7 @@
});
{% endif %}
});
+ {% endif %}
// Callback function when the 'assigned stock' panel is loaded
onPanelLoad('assigned-stock', function() {
diff --git a/InvenTree/company/templates/company/sidebar.html b/InvenTree/company/templates/company/sidebar.html
index 881701f577..7fe616b7d1 100644
--- a/InvenTree/company/templates/company/sidebar.html
+++ b/InvenTree/company/templates/company/sidebar.html
@@ -17,13 +17,19 @@
{% include "sidebar_item.html" with label='company-stock' text=text icon="fa-boxes" %}
{% endif %}
{% if company.is_customer %}
+{% if roles.sales_order.view %}
{% trans "Sales Orders" as text %}
{% include "sidebar_item.html" with label='sales-orders' text=text icon="fa-truck" %}
+{% endif %}
+{% if roles.stock.view %}
{% trans "Assigned Stock Items" as text %}
{% include "sidebar_item.html" with label='assigned-stock' text=text icon="fa-sign-out-alt" %}
+{% endif %}
+{% if roles.return_order.view and return_order_enabled %}
{% trans "Return Orders" as text %}
{% include "sidebar_item.html" with label='return-orders' text=text icon="fa-undo" %}
{% endif %}
+{% endif %}
{% trans "Contacts" as text %}
{% include "sidebar_item.html" with label='company-contacts' text=text icon="fa-users" %}
{% trans "Notes" as text %}
diff --git a/InvenTree/templates/InvenTree/settings/returns.html b/InvenTree/templates/InvenTree/settings/returns.html
index fc53910d33..68674e7cfd 100644
--- a/InvenTree/templates/InvenTree/settings/returns.html
+++ b/InvenTree/templates/InvenTree/settings/returns.html
@@ -11,6 +11,7 @@
+ {% include "InvenTree/settings/setting.html" with key="RETURNORDER_ENABLED" icon="fa-check-circle" %}
{% include "InvenTree/settings/setting.html" with key="RETURNORDER_REFERENCE_PATTERN" %}
diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html
index 73912bcafe..7dcf7ea7ba 100644
--- a/InvenTree/templates/base.html
+++ b/InvenTree/templates/base.html
@@ -5,6 +5,7 @@
{% plugins_enabled as plugins_enabled %}
{% settings_value 'BARCODE_ENABLE' as barcodes %}
{% settings_value 'REPORT_ENABLE_TEST_REPORT' as test_report_enabled %}
+{% settings_value 'RETURNORDER_ENABLED' as return_order_enabled %}
{% settings_value "REPORT_ENABLE" as report_enabled %}
{% settings_value "SERVER_RESTART_REQUIRED" as server_restart_required %}
{% settings_value "LABEL_ENABLE" as labels_enabled %}
diff --git a/InvenTree/templates/navbar.html b/InvenTree/templates/navbar.html
index c9d7b9c79a..1be812c509 100644
--- a/InvenTree/templates/navbar.html
+++ b/InvenTree/templates/navbar.html
@@ -61,7 +61,7 @@
{% if roles.sales_order.view %}
{% trans "Sales Orders" %}
{% endif %}
- {% if roles.return_order.view %}
+ {% if roles.return_order.view and return_order_enabled %}
{% trans "Return Orders" %}
{% endif %}