File tree Expand file tree Collapse file tree 4 files changed +29
-7
lines changed Expand file tree Collapse file tree 4 files changed +29
-7
lines changed Original file line number Diff line number Diff line change 1
- ### 0.14.2 - January 2024
1
+ ### 0.14.2 - February 2024
2
2
---
3
3
4
4
- Updated error reporting
5
+ - Support for updated server API endpoints
6
+ - Updated translations
5
7
6
8
### 0.14.1 - January 2024
7
9
---
Original file line number Diff line number Diff line change @@ -339,6 +339,9 @@ class InvenTreeAPI {
339
339
// Does the server support allocating stock to sales order using barcodes?
340
340
bool get supportsBarcodeSOAllocateEndpoint => isConnected () && apiVersion >= 160 ;
341
341
342
+ // Does the server support "null" top-level filtering for PartCategory and StockLocation endpoints?
343
+ bool get supportsNullTopLevelFiltering => isConnected () && apiVersion < 174 ;
344
+
342
345
// Cached list of plugins (refreshed when we connect to the server)
343
346
List <InvenTreePlugin > _plugins = [];
344
347
Original file line number Diff line number Diff line change @@ -200,13 +200,21 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
200
200
// Construct the "details" panel
201
201
List <Widget > detailTiles () {
202
202
203
+ Map <String , String > filters = {};
204
+
205
+ int ? parent = widget.category? .pk;
206
+
207
+ if (parent != null ) {
208
+ filters["parent" ] = parent.toString ();
209
+ } else if (api.supportsNullTopLevelFiltering) {
210
+ filters["parent" ] = "null" ;
211
+ }
212
+
203
213
List <Widget > tiles = < Widget > [
204
214
getCategoryDescriptionCard (),
205
215
Expanded (
206
216
child: PaginatedPartCategoryList (
207
- {
208
- "parent" : widget.category? .pk.toString () ?? "null"
209
- },
217
+ filters,
210
218
title: L10 ().subcategories,
211
219
),
212
220
flex: 10 ,
Original file line number Diff line number Diff line change @@ -393,13 +393,22 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
393
393
394
394
// Construct the "details" panel
395
395
List <Widget > detailTiles () {
396
+
397
+ Map <String , String > filters = {};
398
+
399
+ int ? parent = location? .pk;
400
+
401
+ if (parent != null ) {
402
+ filters["parent" ] = parent.toString ();
403
+ } else if (api.supportsNullTopLevelFiltering) {
404
+ filters["parent" ] = "null" ;
405
+ }
406
+
396
407
List <Widget > tiles = [
397
408
locationDescriptionCard (),
398
409
Expanded (
399
410
child: PaginatedStockLocationList (
400
- {
401
- "parent" : location? .pk.toString () ?? "null" ,
402
- },
411
+ filters,
403
412
title: L10 ().sublocations,
404
413
),
405
414
flex: 10 ,
You can’t perform that action at this time.
0 commit comments