From 67e0a99012cd194874007022a040a0ddc40a5133 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 24 Feb 2023 13:11:25 +1100 Subject: [PATCH] Fix bug rendering part without a category (#4369) (#4405) (cherry picked from commit bf8a59c6046575f74b74502a16ff3ad2ef0c8ac0) --- 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 229ef6fda9..fcf9b442d7 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -1758,13 +1758,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" %}'; } } };