diff --git a/lib/inventree/part.dart b/lib/inventree/part.dart index 4cbd0cce..b1f22373 100644 --- a/lib/inventree/part.dart +++ b/lib/inventree/part.dart @@ -51,7 +51,9 @@ class InvenTreePartCategory extends InvenTreeModel { return p; } - int get partcount => (jsondata["parts"] ?? 0) as int; + // Return the number of parts in this category + // Note that the API changed from 'parts' to 'part_count' (v69) + int get partcount => (jsondata["part_count"] ?? jsondata["parts"] ?? 0) as int; @override InvenTreeModel createFromJson(Map json) { diff --git a/pubspec.yaml b/pubspec.yaml index fc14c48f..cd98bc20 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: inventree description: InvenTree stock management -version: 0.8.0+46 +version: 0.8.1+47 environment: sdk: ">=2.16.0 <3.0.0"