From e4acca295169298437647c53a3db65d82dca2d05 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 28 May 2019 18:29:12 +1000 Subject: [PATCH] Display stock item serial number (if it exists)! --- InvenTree/static/script/inventree/stock.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/InvenTree/static/script/inventree/stock.js b/InvenTree/static/script/inventree/stock.js index 28c0550bed..f6632b2ec3 100644 --- a/InvenTree/static/script/inventree/stock.js +++ b/InvenTree/static/script/inventree/stock.js @@ -469,7 +469,16 @@ function loadStockTable(table, options) { title: 'Stock', sortable: true, formatter: function(value, row, index, field) { - var text = renderLink(value, row.url); + + var val = value; + + // If there is a single unit with a serial number, use the serial number + if (row.serial && row.quantity == 1) { + val = '# ' + row.serial; + } + + var text = renderLink(val, row.url); + text = text + "" + row.status_text + ""; return text; }