mirror of
https://github.com/inventree/inventree-app.git
synced 2026-10-03 22:15:30 +00:00
Link to parent part category
This commit is contained in:
1 parent
0f2c88e630
commit
683f1e8efd
2 files changed
+39
-7
No files matched your search
@@ -14,6 +14,22 @@ class InvenTreePartCategory extends InvenTreeModel {
|
||||
|
||||
String get pathstring => jsondata['pathstring'] ?? '';
|
||||
|
||||
String get parentpathstring {
|
||||
List<String> psplit = pathstring.split("/");
|
||||
|
||||
if (psplit.length > 0) {
|
||||
psplit.removeLast();
|
||||
}
|
||||
|
||||
String p = psplit.join("/");
|
||||
|
||||
if (p.isEmpty) {
|
||||
p = "Top level parts category";
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
int get partcount => jsondata['parts'] ?? 0;
|
||||
|
||||
InvenTreePartCategory() : super();
|
||||
|
||||
Reference in new issue
Block a user