2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Allow API filtering by "cascading" stock locations

This commit is contained in:
Oliver Walters
2021-04-20 20:00:15 +10:00
parent 6986709fb8
commit 412b05d76c
4 changed files with 64 additions and 12 deletions

View File

@ -957,6 +957,12 @@ function loadStockLocationTable(table, options) {
switchable: true,
sortable: false,
},
{
field: 'pathstring',
title: '{% trans "Path" %}',
switchable: true,
sortable: false,
},
{
field: 'items',
title: '{% trans "Stock Items" %}',

View File

@ -62,6 +62,28 @@ function getAvailableTableFilters(tableKey) {
};
}
// Filters for "stock location" table
if (tableKey == "location") {
return {
cascade: {
type: 'bool',
title: '{% trans "Include sublocations" %}',
description: '{% trans "Include locations" %}',
}
};
}
// Filters for "part category" table
if (tableKey == "category") {
return {
cascade: {
type: 'bool',
title: '{% trans "Include subcategories" %}',
description: '{% trans "Include subcategories" %}',
}
};
}
// Filters for the "customer stock" table (really a subset of "stock")
if (tableKey == "customerstock") {
return {