mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix rendering issues
This commit is contained in:
parent
6a995042c9
commit
7539bd47fe
@ -179,7 +179,11 @@ $("#po-table").inventreeTable({
|
||||
field: 'supplier_part_detail.SKU',
|
||||
title: '{% trans "SKU" %}',
|
||||
formatter: function(value, row, index, field) {
|
||||
return renderLink(value, `/supplier-part/${row.part}/`);
|
||||
if (value) {
|
||||
return renderLink(value, `/supplier-part/${row.part}/`);
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -188,7 +192,7 @@ $("#po-table").inventreeTable({
|
||||
field: 'supplier_part_detail.MPN',
|
||||
title: '{% trans "MPN" %}',
|
||||
formatter: function(value, row, index, field) {
|
||||
if (row.supplier_part_detail.manufacturer_part) {
|
||||
if (row.supplier_part_detail && row.supplier_part_detail.manufacturer_part) {
|
||||
return renderLink(value, `/manufacturer-part/${row.supplier_part_detail.manufacturer_part.pk}/`);
|
||||
} else {
|
||||
return "";
|
||||
|
@ -696,7 +696,14 @@ function loadStockTable(table, options) {
|
||||
}
|
||||
|
||||
var link = `/supplier-part/${row.supplier_part}/stock/`;
|
||||
var text = `${row.supplier_part_detail.SKU}`;
|
||||
|
||||
var text = '';
|
||||
|
||||
if (row.supplier_part_detail) {
|
||||
text = `${row.supplier_part_detail.SKU}`;
|
||||
} else {
|
||||
text = `<i>{% trans "Supplier part not specified" %}</i>`;
|
||||
}
|
||||
|
||||
return renderLink(text, link);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user