diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index e176948599..3768cd8787 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -1234,6 +1234,15 @@ class StockTrackingList(generics.ListAPIView): if not deltas: deltas = {} + # Add part detail + if 'part' in deltas: + try: + part = Part.objects.get(pk=deltas['part']) + serializer = PartBriefSerializer(part) + deltas['part_detail'] = serializer.data + except: + pass + # Add location detail if 'location' in deltas: try: diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index ae0742e99e..75e53d6758 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -26,11 +26,12 @@
-
+
+ {% include "filter_list.html" with id="stocktracking" %}
- +
@@ -342,7 +343,6 @@ ); }); - loadStockTrackingTable($("#track-table"), { params: { ordering: '-date', diff --git a/InvenTree/templates/js/translated/stock.js b/InvenTree/templates/js/translated/stock.js index ff2240b007..c13ea41f99 100644 --- a/InvenTree/templates/js/translated/stock.js +++ b/InvenTree/templates/js/translated/stock.js @@ -2373,6 +2373,19 @@ function loadStockTrackingTable(table, options) { return html; } + // Part information + if (details.part) { + html += `{% trans "Part" %}`; + + if (details.part_detail) { + html += renderLink(details.part_detail.full_name, `/part/${details.part}/`); + } else { + html += `{% trans "Part information unavailable" %}`; + } + + html += ``; + } + // Location information if (details.location) {