From 0a215123293ef21ce4289fbcc290e0c404a6d23c Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 21 Dec 2021 16:41:34 +1100 Subject: [PATCH] Adds refresh and filtering for "company" table --- InvenTree/company/templates/company/index.html | 1 + InvenTree/templates/js/translated/company.js | 1 + .../templates/js/translated/table_filters.js | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html index 1654ab04b5..d7fbee1732 100644 --- a/InvenTree/company/templates/company/index.html +++ b/InvenTree/company/templates/company/index.html @@ -25,6 +25,7 @@
+ {% include "filter_list.html" with id='company' %}
diff --git a/InvenTree/templates/js/translated/company.js b/InvenTree/templates/js/translated/company.js index 4ab7a7fa3d..176f2f9f72 100644 --- a/InvenTree/templates/js/translated/company.js +++ b/InvenTree/templates/js/translated/company.js @@ -380,6 +380,7 @@ function loadCompanyTable(table, url, options={}) { url: url, method: 'get', queryParams: filters, + original: params, groupBy: false, sidePagination: 'server', formatNoMatches: function() { diff --git a/InvenTree/templates/js/translated/table_filters.js b/InvenTree/templates/js/translated/table_filters.js index 76c129abdc..d9f2014c14 100644 --- a/InvenTree/templates/js/translated/table_filters.js +++ b/InvenTree/templates/js/translated/table_filters.js @@ -381,6 +381,24 @@ function getAvailableTableFilters(tableKey) { }; } + // Filters for "company" table + if (tableKey == 'company') { + return { + is_manufacturer: { + type: 'bool', + title: '{% trans "Manufacturer" %}', + }, + is_supplier: { + type: 'bool', + title: '{% trans "Supplier" %}', + }, + is_customer: { + type: 'bool', + title: '{% trans "Customer" %}', + }, + }; + } + // Filters for the "Parts" table if (tableKey == 'parts') { return {