Adds refresh and filtering for "company" table

This commit is contained in:
Oliver 2021-12-21 16:41:34 +11:00
parent 09777c5764
commit 0a21512329
3 changed files with 20 additions and 0 deletions

View File

@ -25,6 +25,7 @@
<div class='panel-content'>
<div id='button-toolbar'>
{% include "filter_list.html" with id='company' %}
</div>
<table class='table table-striped table-condensed' id='company-table' data-toolbar='#button-toolbar'>

View File

@ -380,6 +380,7 @@ function loadCompanyTable(table, url, options={}) {
url: url,
method: 'get',
queryParams: filters,
original: params,
groupBy: false,
sidePagination: 'server',
formatNoMatches: function() {

View File

@ -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 {