From 52045676281f6ff306620ecdf340ba4d5d8c3324 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 18 May 2021 19:06:41 +1000 Subject: [PATCH] Bug fix for stock item tracking API --- InvenTree/stock/api.py | 3 +++ InvenTree/templates/js/stock.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index 376d04f643..3fc440cae4 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -1018,6 +1018,9 @@ class StockTrackingList(generics.ListAPIView): for item in data: deltas = item['deltas'] + if not deltas: + deltas = {} + # Add location detail if 'location' in deltas: try: diff --git a/InvenTree/templates/js/stock.js b/InvenTree/templates/js/stock.js index 8f06d403ee..b89cceea83 100644 --- a/InvenTree/templates/js/stock.js +++ b/InvenTree/templates/js/stock.js @@ -1017,6 +1017,11 @@ function loadStockTrackingTable(table, options) { formatter: function(details, row, index, field) { var html = ``; + if (!details) { + html += '
'; + return html; + } + // Location information if (details.location) {