2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

Add "external" field to StockLocation (#4377)

* Add "external" field to StockLocation

- New model for field
- Database migrations
- Serializer / API updates
- Front end tables / filters

* Update API version
This commit is contained in:
Oliver
2023-02-21 00:42:18 +11:00
committed by GitHub
parent 782ae133b7
commit 75ca325892
7 changed files with 54 additions and 2 deletions

View File

@ -117,6 +117,7 @@ function stockLocationFields(options={}) {
description: {},
owner: {},
structural: {},
external: {},
icon: {
help_text: `{% trans "Icon (optional) - Explore all available icons on" %} <a href="https://fontawesome.com/v5/search?s=solid" target="_blank" rel="noopener noreferrer">Font Awesome</a>.`,
placeholder: 'fas fa-box',
@ -2491,6 +2492,24 @@ function loadStockLocationTable(table, options) {
title: '{% trans "Stock Items" %}',
switchable: true,
sortable: true,
},
{
field: 'structural',
title: '{% trans "Structural" %}',
switchable: true,
sortable: false,
formatter: function(value) {
return yesNoLabel(value);
}
},
{
field: 'external',
title: '{% trans "External" %}',
switchable: true,
sortable: false,
formatter: function(value) {
return yesNoLabel(value);
}
}
]
});

View File

@ -134,6 +134,10 @@ function getAvailableTableFilters(tableKey) {
type: 'bool',
title: '{% trans "Structural" %}',
},
external: {
type: 'bool',
title: '{% trans "External" %}',
},
};
}