From e87f545d75fbbdbef977a12e0eb87bf2f7a21604 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 14 May 2019 18:12:17 +1000 Subject: [PATCH] Render zero stock as 'No Stock' in BOM table --- InvenTree/static/script/inventree/bom.js | 3 +++ InvenTree/static/script/inventree/part.js | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/InvenTree/static/script/inventree/bom.js b/InvenTree/static/script/inventree/bom.js index fd7f2ebd9d..46bdc249ef 100644 --- a/InvenTree/static/script/inventree/bom.js +++ b/InvenTree/static/script/inventree/bom.js @@ -132,6 +132,9 @@ function loadBomTable(table, options) { } else { + if (!value) { + value = 'No Stock'; + } text = "" + value + ""; } diff --git a/InvenTree/static/script/inventree/part.js b/InvenTree/static/script/inventree/part.js index c66fe405b2..51d86f1c7a 100644 --- a/InvenTree/static/script/inventree/part.js +++ b/InvenTree/static/script/inventree/part.js @@ -119,13 +119,12 @@ function loadPartTable(table, url, options={}) { visible: false, }, { - field: 'name', + field: 'full_name', title: 'Part', sortable: true, formatter: function(value, row, index, field) { - var name = row.full_name; - var display = imageHoverIcon(row.image_url) + renderLink(name, row.url); + var display = imageHoverIcon(row.image_url) + renderLink(value, row.url); if (!row.active) { display = display + "INACTIVE"; } @@ -160,7 +159,7 @@ function loadPartTable(table, url, options={}) { return renderLink(value, row.url + 'stock/'); } else { - return "No stock"; + return "No Stock"; } } }