mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Upload test result against a StockItem object
This commit is contained in:
parent
d666bdb957
commit
ec1f9a8923
1 changed files with 19 additions and 0 deletions
|
|
@ -128,6 +128,25 @@ class InvenTreeStockItem extends InvenTreeModel {
|
|||
});
|
||||
}
|
||||
|
||||
Future<bool> uploadTestResult(BuildContext context, String testName, bool result, {String value, String notes}) async {
|
||||
|
||||
Map<String, dynamic> data = {
|
||||
"stock_item": pk,
|
||||
"test": testName,
|
||||
"result": result,
|
||||
};
|
||||
|
||||
if (value != null && !value.isEmpty) {
|
||||
data["value"] = value;
|
||||
}
|
||||
|
||||
if (notes != null && !notes.isEmpty) {
|
||||
data["notes"] = notes;
|
||||
}
|
||||
|
||||
InvenTreeStockItemTestResult().create(context, data);
|
||||
}
|
||||
|
||||
int get partId => jsondata['part'] ?? -1;
|
||||
|
||||
int get trackingItemCount => jsondata['tracking_items'] as int ?? 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue