mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge branch 'master' of github.com:eeintech/InvenTree into bom_dev
This commit is contained in:
commit
51c194fb8f
@ -9,6 +9,12 @@
|
||||
<h4>{% trans "Assigned Stock" %}</h4>
|
||||
<hr>
|
||||
|
||||
<div id='button-toolbar'>
|
||||
<div class='filter-list' id='filter-list-stock'>
|
||||
<!-- An empty div in which the filter list will be constructed -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class='table table-striped table-condensed' id='stock-table'></table>
|
||||
|
||||
{% endblock %}
|
||||
@ -18,12 +24,12 @@
|
||||
|
||||
loadStockTable($("#stock-table"), {
|
||||
params: {
|
||||
test: 7,
|
||||
customer: {{ company.id }},
|
||||
part_detail: true,
|
||||
location_detail: true,
|
||||
},
|
||||
url: "{% url 'api-stock-list' %}",
|
||||
filterKey: "customerstock",
|
||||
});
|
||||
|
||||
{% endblock %}
|
@ -234,9 +234,11 @@ function loadStockTable(table, options) {
|
||||
var filterListElement = options.filterList || "#filter-list-stock";
|
||||
|
||||
var filters = {};
|
||||
|
||||
|
||||
var filterKey = options.filterKey || "stock";
|
||||
|
||||
if (!options.disableFilters) {
|
||||
filters = loadTableFilters("stock");
|
||||
filters = loadTableFilters(filterKey);
|
||||
}
|
||||
|
||||
var original = {};
|
||||
@ -245,7 +247,7 @@ function loadStockTable(table, options) {
|
||||
original[key] = params[key];
|
||||
}
|
||||
|
||||
setupFilterList("stock", table, filterListElement);
|
||||
setupFilterList(filterKey, table, filterListElement);
|
||||
|
||||
// Override the default values, or add new ones
|
||||
for (var key in params) {
|
||||
|
@ -11,6 +11,24 @@ function getAvailableTableFilters(tableKey) {
|
||||
|
||||
tableKey = tableKey.toLowerCase();
|
||||
|
||||
// Filters for the "customer stock" table (really a subset of "stock")
|
||||
if (tableKey == "customerstock") {
|
||||
return {
|
||||
serialized: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Is Serialized" %}',
|
||||
},
|
||||
serial_gte: {
|
||||
title: "{% trans "Serial number GTE" %}",
|
||||
description: "{% trans "Serial number greater than or equal to" %}"
|
||||
},
|
||||
serial_lte: {
|
||||
title: "{% trans "Serial number LTE" %}",
|
||||
description: "{% trans "Serial number less than or equal to" %}",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// Filters for the "Stock" table
|
||||
if (tableKey == 'stock') {
|
||||
return {
|
||||
@ -39,6 +57,10 @@ function getAvailableTableFilters(tableKey) {
|
||||
title: '{% trans "Is allocated" %}',
|
||||
description: '{% trans "Item has been alloacted" %}',
|
||||
},
|
||||
serialized: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Is Serialized" %}',
|
||||
},
|
||||
serial_gte: {
|
||||
title: "{% trans "Serial number GTE" %}",
|
||||
description: "{% trans "Serial number greater than or equal to" %}"
|
||||
|
Loading…
Reference in New Issue
Block a user