2
0
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:
Oliver Walters
2020-09-28 20:07:25 +10:00
parent 8dd8e69c05
commit f253bf1843
7 changed files with 72 additions and 11 deletions

View File

@ -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>';
}
}
},