mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Link to parent part category
This commit is contained in:
parent
0f2c88e630
commit
683f1e8efd
2 changed files with 39 additions and 7 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue