2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-01 21:16:46 +00:00

Fix bug rendering part without a category (#4369) (#4405)

(cherry picked from commit bf8a59c6046575f74b74502a16ff3ad2ef0c8ac0)
This commit is contained in:
Oliver 2023-02-24 13:11:25 +11:00 committed by GitHub
parent 40c74c7563
commit 67e0a99012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 '<em>{% trans "No category" %}</em>';
}
}
};