mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Better dispaly of stock status
- Send status text in JSON - Only display status if it is not "OK"
This commit is contained in:
parent
82f3773aa1
commit
013a85e6f7
@ -153,7 +153,10 @@ function loadStockTable(table, options) {
|
||||
|
||||
var text = renderLink(val, '/stock/item/' + row.pk + '/');
|
||||
|
||||
text = text + "<span class='badge'>" + row.status_text + "</span>";
|
||||
if (row.status_text != 'OK') {
|
||||
text = text + "<span class='badge'>" + row.status_text + "</span>";
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
},
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user