2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

Add ability to display "out of stock" items against a part

This commit is contained in:
Oliver Walters
2020-06-22 10:48:41 +10:00
parent 16bea33695
commit 930f903f5d
7 changed files with 15 additions and 14 deletions

View File

@ -494,10 +494,15 @@ function loadStockTable(table, options) {
sortable: true,
formatter: function(value, row, index, field) {
if (value) {
return renderLink(value, '/stock/location/' + row.location + '/');
return renderLink(value, `/stock/location/${row.location}/`);
}
else {
return '<i>{% trans "No stock location set" %}</i>';
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>';
}
}
}
},

View File

@ -14,6 +14,11 @@ function getAvailableTableFilters(tableKey) {
// Filters for the "Stock" table
if (tableKey == 'stock') {
return {
in_stock: {
type: 'bool',
title: '{% trans "In Stock" %}',
description: '{% trans "Show items which are in stock" %}',
},
cascade: {
type: 'bool',
title: '{% trans "Include sublocations" %}',