From bf8a59c6046575f74b74502a16ff3ad2ef0c8ac0 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 19 Feb 2023 22:39:36 +1100 Subject: [PATCH] Fix bug rendering part without a category (#4369) --- InvenTree/templates/js/translated/part.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index a5a09945fa..17449d9647 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -1835,13 +1835,11 @@ function loadPartTable(table, url, options={}) { field: 'category_detail', title: '{% trans "Category" %}', formatter: function(value, row) { - - var text = shortenString(row.category_detail.pathstring); - - if (row.category) { + if (row.category && row.category_detail) { + var text = shortenString(row.category_detail.pathstring); return withTitle(renderLink(text, `/part/category/${row.category}/`), row.category_detail.pathstring); } else { - return '{% trans "No category" %}'; + return '{% trans "No category" %}'; } } };