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:
@ -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'] ?? '';
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user