From 770d9cddb23d356e13414e87f0be0976e54ae171 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 20 Jun 2023 20:38:07 +1000 Subject: [PATCH] Add ability to filter stock by "in_stock" (#376) --- assets/release_notes.md | 6 ++++++ lib/inventree/stock.dart | 1 - lib/widget/part_list.dart | 1 + lib/widget/stock_list.dart | 6 ++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/assets/release_notes.md b/assets/release_notes.md index 996ff5ab..15bc1545 100644 --- a/assets/release_notes.md +++ b/assets/release_notes.md @@ -1,3 +1,8 @@ +### - +--- + +- Improved filters for stock list + ### 0.12.2 - June 2023 --- @@ -7,6 +12,7 @@ - Bug fix for scrolling long lists ### 0.12.1 - May 2023 +--- - Fixes bug in purchase order form diff --git a/lib/inventree/stock.dart b/lib/inventree/stock.dart index da797783..7d06fa52 100644 --- a/lib/inventree/stock.dart +++ b/lib/inventree/stock.dart @@ -186,7 +186,6 @@ class InvenTreeStockItem extends InvenTreeModel { "part_detail": "true", "location_detail": "true", "supplier_detail": "true", - "in_stock": "true", }; } diff --git a/lib/widget/part_list.dart b/lib/widget/part_list.dart index 0b00bb90..5235e54f 100644 --- a/lib/widget/part_list.dart +++ b/lib/widget/part_list.dart @@ -91,6 +91,7 @@ class _PaginatedPartListState extends PaginatedSearchState { "active": { "label": L10().filterActive, "help_text": L10().filterActiveDetail, + "tristate": true, }, "assembly": { "label": L10().filterAssembly, diff --git a/lib/widget/stock_list.dart b/lib/widget/stock_list.dart index c1a3232a..fee6d112 100644 --- a/lib/widget/stock_list.dart +++ b/lib/widget/stock_list.dart @@ -80,6 +80,12 @@ class _PaginatedStockItemListState extends PaginatedSearchState> get filterOptions => { + "in_stock": { + "default": true, + "label": L10().filterInStock, + "help_text": L10().filterInStockDetail, + "tristate": true, + }, "cascade": { "default": false, "label": L10().includeSublocations,