diff --git a/InvenTree/part/serializers.py b/InvenTree/part/serializers.py index 3b6d823ddc..47ce3f66c8 100644 --- a/InvenTree/part/serializers.py +++ b/InvenTree/part/serializers.py @@ -255,6 +255,9 @@ class PartSerializer(InvenTreeModelSerializer): to reduce database trips. """ + # TODO: Update the "in_stock" annotation to include stock for variants of the part + # Ref: https://github.com/inventree/InvenTree/issues/2240 + # Annotate with the total 'in stock' quantity queryset = queryset.annotate( in_stock=Coalesce( diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index fc9795b6e0..d3da4df514 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -62,7 +62,7 @@ {% endif %} {% if part.minimum_stock %} - + {% trans "Minimum stock level" %} {{ part.minimum_stock }} diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index b87ec6d0dc..44bc70fc37 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -139,8 +139,7 @@ loadSimplePartTable("#table-bom-validation", "{% url 'api-part-list' %}", { {% to_list setting_stock_recent setting_stock_low setting_stock_depleted setting_stock_needed as settings_list_stock %} {% endif %} -{% if roles.stock.view and True in settings_list_stock %} -addHeaderTitle('{% trans "Stock" %}'); +{% if roles.stock.view %} {% if setting_stock_recent %} addHeaderAction('recently-updated-stock', '{% trans "Recently Updated" %}', 'fa-clock'); @@ -156,7 +155,7 @@ loadStockTable($('#table-recently-updated-stock'), { {% endif %} {% if setting_stock_low %} -addHeaderAction('low-stock', '{% trans "Low Stock" %}', 'fa-shopping-cart'); +addHeaderAction('low-stock', '{% trans "Low Stock" %}', 'fa-flag'); loadSimplePartTable("#table-low-stock", "{% url 'api-part-list' %}", { params: { low_stock: true,