2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-16 01:36:29 +00:00

Required for order fix (#5077)

* Fix part tables on index page

- Stop table filters overriding each other

* Refactor "needed for build" table

- Now shows amount actually needed

* Fix typo

* js fix

* linting

* Fix warning messages on index page

* js linting
This commit is contained in:
Oliver
2023-06-20 12:39:18 +10:00
committed by GitHub
parent 4c9d4add2c
commit 09cc654530
7 changed files with 213 additions and 118 deletions

View File

@@ -1843,44 +1843,48 @@ function loadStockTable(table, options) {
var params = options.params || {};
const filterTarget = options.filterTarget || '#filter-list-stock';
let filters = {};
const filterKey = options.filterKey || options.name || 'stock';
if (!options.disableFilters) {
let filters = loadTableFilters(filterKey, params);
const filterTarget = options.filterTarget || '#filter-list-stock';
const filterKey = options.filterKey || options.name || 'stock';
setupFilterList(filterKey, table, filterTarget, {
download: true,
report: {
url: '{% url "api-stockitem-testreport-list" %}',
key: 'item',
},
labels: {
url: '{% url "api-stockitem-label-list" %}',
key: 'item',
},
singular_name: '{% trans "stock item" %}',
plural_name: '{% trans "stock items" %}',
barcode_actions: [
{
icon: 'fa-sitemap',
label: 'scantolocation',
title: '{% trans "Scan to location" %}',
permission: 'stock.change',
callback: function(items) {
scanItemsIntoLocation(items);
filters = loadTableFilters(filterKey, params);
setupFilterList(filterKey, table, filterTarget, {
download: true,
report: {
url: '{% url "api-stockitem-testreport-list" %}',
key: 'item',
},
labels: {
url: '{% url "api-stockitem-label-list" %}',
key: 'item',
},
singular_name: '{% trans "stock item" %}',
plural_name: '{% trans "stock items" %}',
barcode_actions: [
{
icon: 'fa-sitemap',
label: 'scantolocation',
title: '{% trans "Scan to location" %}',
permission: 'stock.change',
callback: function(items) {
scanItemsIntoLocation(items);
}
}
}
],
custom_actions: [
{
actions: makeStockActions(table),
icon: 'fa-boxes',
title: '{% trans "Stock Actions" %}',
label: 'stock',
}
]
});
],
custom_actions: [
{
actions: makeStockActions(table),
icon: 'fa-boxes',
title: '{% trans "Stock Actions" %}',
label: 'stock',
}
]
});
}
// Override the default values, or add new ones
for (var key in params) {