mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix bug rendering part without a category (#4369)
This commit is contained in:
parent
32be1b2035
commit
bf8a59c604
@ -1835,13 +1835,11 @@ function loadPartTable(table, url, options={}) {
|
|||||||
field: 'category_detail',
|
field: 'category_detail',
|
||||||
title: '{% trans "Category" %}',
|
title: '{% trans "Category" %}',
|
||||||
formatter: function(value, row) {
|
formatter: function(value, row) {
|
||||||
|
if (row.category && row.category_detail) {
|
||||||
var text = shortenString(row.category_detail.pathstring);
|
var text = shortenString(row.category_detail.pathstring);
|
||||||
|
|
||||||
if (row.category) {
|
|
||||||
return withTitle(renderLink(text, `/part/category/${row.category}/`), row.category_detail.pathstring);
|
return withTitle(renderLink(text, `/part/category/${row.category}/`), row.category_detail.pathstring);
|
||||||
} else {
|
} else {
|
||||||
return '{% trans "No category" %}';
|
return '<em>{% trans "No category" %}</em>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user