mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +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:
parent
30ea893023
commit
d122a352a6
@ -1,6 +1,14 @@
|
||||
## 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
|
||||
---
|
||||
|
||||
|
@ -259,6 +259,9 @@ class InvenTreeAPI {
|
||||
// Notification support requires API v25 or newer
|
||||
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?
|
||||
bool _pluginsEnabled = false;
|
||||
|
||||
|
@ -25,11 +25,18 @@ class InvenTreePartCategory extends InvenTreeModel {
|
||||
@override
|
||||
Map<String, dynamic> formFields() {
|
||||
|
||||
return {
|
||||
Map<String, dynamic> fields = {
|
||||
"name": {},
|
||||
"description": {},
|
||||
"parent": {}
|
||||
"parent": {},
|
||||
"structural": {},
|
||||
};
|
||||
|
||||
if (!api.supportsStructuralCategories) {
|
||||
fields.remove("structural");
|
||||
}
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
String get pathstring => (jsondata["pathstring"] ?? "") as String;
|
||||
|
@ -652,13 +652,18 @@ class InvenTreeStockLocation extends InvenTreeModel {
|
||||
|
||||
@override
|
||||
Map<String, dynamic> formFields() {
|
||||
return {
|
||||
Map<String, dynamic> fields = {
|
||||
"name": {},
|
||||
"description": {},
|
||||
"parent": {
|
||||
|
||||
},
|
||||
"parent": {},
|
||||
"structural": {},
|
||||
};
|
||||
|
||||
if (!api.supportsStructuralCategories) {
|
||||
fields.remove("structural");
|
||||
}
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
String get parentPathString {
|
||||
|
Loading…
x
Reference in New Issue
Block a user