diff --git a/InvenTree/templates/js/translated/filters.js b/InvenTree/templates/js/translated/filters.js index 8845fc39e1..53429effea 100644 --- a/InvenTree/templates/js/translated/filters.js +++ b/InvenTree/templates/js/translated/filters.js @@ -283,21 +283,24 @@ function setupFilterList(tableKey, table, target) { element.append(``); - // If there are available filters, add them in! - if (filters.length > 0) { - element.append(``); + // If there are no filters defined for this table, exit now + if (jQuery.isEmptyObject(getAvailableTableFilters(tableKey))) { + return; + } - if (Object.keys(filters).length > 0) { - element.append(``); - } + // If there are filters currently "in use", add them in! + element.append(``); - for (var key in filters) { - var value = getFilterOptionValue(tableKey, key, filters[key]); - var title = getFilterTitle(tableKey, key); - var description = getFilterDescription(tableKey, key); + if (Object.keys(filters).length > 0) { + element.append(``); + } - element.append(`