mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 12:10:59 +00:00
Stock API filtering fix (#4350)
* Improve filtering options for StockItem list - Make use of StockFilter introspection * Remove outdated filter * remove outdated "max_results" parameter * Fix cascade issue for stocklist API * Add relationship filters to the StockItemFilter * Fix filtering by 'status' and 'allocated' * Refactor 'customer' and 'expired' filters * Cleanup * Adds unit test for top-level stock location filtering
This commit is contained in:
InvenTree
@ -109,7 +109,7 @@ addHeaderAction('latest-parts', '{% trans "Latest Parts" %}', 'fa-newspaper');
|
||||
loadSimplePartTable("#table-latest-parts", "{% url 'api-part-list' %}", {
|
||||
params: {
|
||||
ordering: "-creation_date",
|
||||
max_results: {% settings_value "PART_RECENT_COUNT" user=request.user %},
|
||||
limit: {% settings_value "PART_RECENT_COUNT" user=request.user %},
|
||||
},
|
||||
name: 'latest_parts',
|
||||
});
|
||||
@ -147,7 +147,7 @@ loadStockTable($('#table-recently-updated-stock'), {
|
||||
params: {
|
||||
part_detail: true,
|
||||
ordering: "-updated",
|
||||
max_results: {% settings_value "STOCK_RECENT_COUNT" user=request.user %},
|
||||
limit: {% settings_value "STOCK_RECENT_COUNT" user=request.user %},
|
||||
},
|
||||
name: 'recently-updated-stock',
|
||||
grouping: false,
|
||||
|
@ -2742,7 +2742,7 @@ function loadInstalledInTable(table, options) {
|
||||
table.inventreeTable({
|
||||
url: '{% url "api-stock-list" %}',
|
||||
queryParams: {
|
||||
installed_in: options.stock_item,
|
||||
belongs_to: options.stock_item,
|
||||
part_detail: true,
|
||||
},
|
||||
formatNoMatches: function() {
|
||||
|
Reference in New Issue
Block a user