mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Bug fixes:
- prevent addition of empty filter tags
This commit is contained in:
parent
57d7d729c1
commit
d606df16f7
@ -16,6 +16,7 @@ function defaultFilters() {
|
||||
return {
|
||||
stock: "cascade=1",
|
||||
build: "",
|
||||
parts: "cascade=1",
|
||||
};
|
||||
}
|
||||
|
||||
@ -308,12 +309,15 @@ function setupFilterList(tableKey, table, target) {
|
||||
var tag = element.find(`#filter-tag-${tableKey}`).val();
|
||||
var val = element.find(`#filter-value-${tableKey}`).val();
|
||||
|
||||
var filters = addTableFilter(tableKey, tag, val);
|
||||
// Only add the new filter if it is not empty!
|
||||
if (tag && tag.length > 0) {
|
||||
var filters = addTableFilter(tableKey, tag, val);
|
||||
reloadTable(table, filters);
|
||||
|
||||
// Run this function again
|
||||
setupFilterList(tableKey, table, target);
|
||||
}
|
||||
|
||||
reloadTable(table, filters);
|
||||
|
||||
// Run this function again
|
||||
setupFilterList(tableKey, table, target);
|
||||
});
|
||||
} else {
|
||||
addClicked = false;
|
||||
|
@ -106,7 +106,7 @@ function loadPurchaseOrderTable(table, options) {
|
||||
|
||||
var params = options.params || {};
|
||||
|
||||
var filters = loadTableFilters("build");
|
||||
var filters = loadTableFilters("order");
|
||||
|
||||
for (var key in params) {
|
||||
filters[key] = params[key];
|
||||
|
@ -19,8 +19,8 @@ function getAvailableTableFilters(tableKey) {
|
||||
return {
|
||||
cascade: {
|
||||
type: 'bool',
|
||||
description: '{% trans "Include stock in sublocations" %}',
|
||||
title: '{% trans "Include sublocations" %}',
|
||||
description: '{% trans "Include stock in sublocations" %}',
|
||||
},
|
||||
active: {
|
||||
type: 'bool',
|
||||
|
Loading…
Reference in New Issue
Block a user