diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index f05a325f78..16545e5914 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -1875,6 +1875,13 @@ class InvenTreeUserSetting(BaseInvenTreeSetting): 'validator': bool, }, + 'HOMEPAGE_SO_SHIPMENTS_PENDING': { + 'name': _('Show pending SO shipments'), + 'description': _('Show pending SO shipments on the homepage'), + 'default': True, + 'validator': bool, + }, + 'HOMEPAGE_NEWS': { 'name': _('Show News'), 'description': _('Show news on the homepage'), diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index 2bad58f61c..0ba67f5821 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -301,7 +301,8 @@ loadPurchaseOrderTable("#table-po-overdue", { {% settings_value 'HOMEPAGE_SO_OUTSTANDING' user=request.user as setting_so_outstanding %} {% settings_value 'HOMEPAGE_SO_OVERDUE' user=request.user as setting_so_overdue %} -{% to_list setting_so_outstanding setting_so_overdue as settings_list_so %} +{% settings_value 'HOMEPAGE_SO_SHIPMENTS_PENDING' user=request.user as setting_so_shipments_pending %} +{% to_list setting_so_outstanding setting_so_overdue setting_so_shipments_pending as settings_list_so %} {% if roles.sales_order.view and True in settings_list_so %} addHeaderTitle('{% trans "Sales Orders" %}'); @@ -328,6 +329,17 @@ loadSalesOrderTable("#table-so-overdue", { }); {% endif %} +{% if setting_so_shipments_pending %} +addHeaderAction('so-shipments', '{% trans "Pending Shipments" %}', 'fa-truck-loading'); +loadSalesOrderShipmentTable("#table-so-shipments", { + url: "{% url 'api-so-shipment-list' %}", + params: { + shipped: false, + }, + show_so_reference: true, +}); +{% endif %} + {% endif %} {% settings_value 'HOMEPAGE_NEWS' user=request.user as setting_news %} diff --git a/InvenTree/templates/InvenTree/settings/user_homepage.html b/InvenTree/templates/InvenTree/settings/user_homepage.html index 9265484d37..4a990e5138 100644 --- a/InvenTree/templates/InvenTree/settings/user_homepage.html +++ b/InvenTree/templates/InvenTree/settings/user_homepage.html @@ -37,6 +37,7 @@