2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-17 04:35:26 +00:00

More display items for Part view:

- BOM count
- Used in count
- Notes
This commit is contained in:
Oliver Walters
2020-04-05 15:50:13 +10:00
parent d1fba27f3a
commit fbd52e1414
4 changed files with 85 additions and 9 deletions

View File

@ -41,6 +41,8 @@ class InvenTreeModel {
String get description => jsondata['description'] ?? '';
String get notes => jsondata['notes'] ?? '';
int get parentId => jsondata['parent'] ?? -1;
String get link => jsondata['URL'] ?? '';

View File

@ -45,6 +45,12 @@ class InvenTreePart extends InvenTreeModel {
// Get the number of units being build for this Part
double get building => double.tryParse(jsondata['building'].toString() ?? '0');
// Get the number of BOM items in this Part (if it is an assembly)
int get bomItemCount => jsondata['bom_items'] as int ?? 0;
// Get the number of BOMs this Part is used in (if it is a component)
int get usedInCount => jsondata['used_in'] as int ?? 0;
bool get isAssembly => jsondata['assembly'] ?? false;
bool get isComponent => jsondata['component'] ?? false;