mirror of
https://github.com/inventree/inventree-app.git
synced 2026-10-03 14:05:28 +00:00
Add accessor functions for SupplierPart and ManufacturerPart models
This commit is contained in:
1 parent
76e0dd6803
commit
21985584c2
2 files changed
+15
-1
No files matched your search
@@ -52,6 +52,14 @@ class InvenTreeSupplierPart extends InvenTreeModel {
|
||||
// TODO
|
||||
}
|
||||
|
||||
int get manufacturerId => (jsondata['manufacturer'] ?? -1) as int;
|
||||
|
||||
int get manufacturerPartId => (jsondata['manufacturer_part'] ?? -1) as int;
|
||||
|
||||
int get supplierId => (jsondata['supplier'] ?? -1) as int;
|
||||
|
||||
String get SKU => (jsondata['SKU'] ?? '') as String;
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
||||
var part = InvenTreeSupplierPart.fromJson(json);
|
||||
@@ -71,6 +79,12 @@ class InvenTreeManufacturerPart extends InvenTreeModel {
|
||||
InvenTreeManufacturerPart.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
|
||||
}
|
||||
|
||||
int get partId => (jsondata['part'] ?? -1) as int;
|
||||
|
||||
int get manufacturerId => (jsondata['manufacturer'] ?? -1) as int;
|
||||
|
||||
String get MPN => (jsondata['MPN'] ?? '') as String;
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
||||
var part = InvenTreeManufacturerPart.fromJson(json);
|
||||
|
||||
+1
-1
Submodule lib/l10n updated: b49ea65800...f53df5968c.
Reference in new issue
Block a user