2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Structural categories (#220)

* Add support for editing "structural" tree field

- Requires API v83 or newer

* Update release notes
This commit is contained in:
Oliver 2022-11-28 20:18:57 +11:00 committed by GitHub
parent 30ea893023
commit d122a352a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 6 deletions

View File

@ -1,6 +1,14 @@
## InvenTree App Release Notes ## InvenTree App Release Notes
--- ---
### - December 2022
---
- Add support for structural part categories
- Add support for structural stock locations
- Updated translations
### 0.8.3 - September 2022 ### 0.8.3 - September 2022
--- ---

View File

@ -259,6 +259,9 @@ class InvenTreeAPI {
// Notification support requires API v25 or newer // Notification support requires API v25 or newer
bool get supportsNotifications => isConnected() && apiVersion >= 25; bool get supportsNotifications => isConnected() && apiVersion >= 25;
// Structural categories requires API v83 or newer
bool get supportsStructuralCategories => isConnected() && apiVersion >= 83;
// Are plugins enabled on the server? // Are plugins enabled on the server?
bool _pluginsEnabled = false; bool _pluginsEnabled = false;

View File

@ -25,11 +25,18 @@ class InvenTreePartCategory extends InvenTreeModel {
@override @override
Map<String, dynamic> formFields() { Map<String, dynamic> formFields() {
return { Map<String, dynamic> fields = {
"name": {}, "name": {},
"description": {}, "description": {},
"parent": {} "parent": {},
"structural": {},
}; };
if (!api.supportsStructuralCategories) {
fields.remove("structural");
}
return fields;
} }
String get pathstring => (jsondata["pathstring"] ?? "") as String; String get pathstring => (jsondata["pathstring"] ?? "") as String;

View File

@ -652,13 +652,18 @@ class InvenTreeStockLocation extends InvenTreeModel {
@override @override
Map<String, dynamic> formFields() { Map<String, dynamic> formFields() {
return { Map<String, dynamic> fields = {
"name": {}, "name": {},
"description": {}, "description": {},
"parent": { "parent": {},
"structural": {},
},
}; };
if (!api.supportsStructuralCategories) {
fields.remove("structural");
}
return fields;
} }
String get parentPathString { String get parentPathString {