mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-24 07:40:54 +00:00
Add ability for stock API to be filtered by installed status
This commit is contained in:
@ -512,16 +512,20 @@ function loadStockTable(table, options) {
|
||||
title: '{% trans "Location" %}',
|
||||
sortable: true,
|
||||
formatter: function(value, row, index, field) {
|
||||
if (value) {
|
||||
if (row.belongs_to) {
|
||||
var text = "{% trans 'Installed in Stock Item ' %}" + row.belongs_to;
|
||||
var url = `/stock/item/${row.belongs_to}/installed/`;
|
||||
|
||||
return renderLink(text, url);
|
||||
} else if (row.customer) {
|
||||
var text = "{% trans "Shipped to customer" %}";
|
||||
return renderLink(text, `/company/${row.customer}/assigned-stock/`);
|
||||
}
|
||||
else if (value) {
|
||||
return renderLink(value, `/stock/location/${row.location}/`);
|
||||
}
|
||||
else {
|
||||
if (row.customer) {
|
||||
var text = "{% trans "Shipped to customer" %}";
|
||||
return renderLink(text, `/company/${row.customer}/assigned-stock/`);
|
||||
} else {
|
||||
return '<i>{% trans "No stock location set" %}</i>';
|
||||
}
|
||||
return '<i>{% trans "No stock location set" %}</i>';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user