diff --git a/lib/inventree/stock.dart b/lib/inventree/stock.dart index bfdc00a4..941e6aff 100644 --- a/lib/inventree/stock.dart +++ b/lib/inventree/stock.dart @@ -128,6 +128,25 @@ class InvenTreeStockItem extends InvenTreeModel { }); } + Future uploadTestResult(BuildContext context, String testName, bool result, {String value, String notes}) async { + + Map 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;