From 013a85e6f78c9faad2e427d237f75c3ed28c7a6a Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 2 Jun 2019 13:53:11 +1000 Subject: [PATCH] Better dispaly of stock status - Send status text in JSON - Only display status if it is not "OK" --- InvenTree/static/script/inventree/stock.js | 5 ++++- InvenTree/stock/api.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/InvenTree/static/script/inventree/stock.js b/InvenTree/static/script/inventree/stock.js index 65b0c55da5..facbaa65f5 100644 --- a/InvenTree/static/script/inventree/stock.js +++ b/InvenTree/static/script/inventree/stock.js @@ -153,7 +153,10 @@ function loadStockTable(table, options) { var text = renderLink(val, '/stock/item/' + row.pk + '/'); - text = text + "" + row.status_text + ""; + if (row.status_text != 'OK') { + text = text + "" + row.status_text + ""; + } + return text; } }, diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index c1c2b8e1cf..dd899ebe0a 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -306,6 +306,8 @@ class StockList(generics.ListCreateAPIView): else: item['location__path'] = None + item['status_text'] = StockItem.ITEM_STATUS_CODES[item['status']] + return Response(data) def get_queryset(self):