mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Barcode workflow (#485)
* Refactor stock barcode operations into new file * Add setting to control confirmation of stock transfer actions * Update details when scannign stock item * Confirm movement when moving items into location * Cleanup
This commit is contained in:
parent
a889417fe0
commit
4499f3e00e
14 changed files with 403 additions and 281 deletions
|
|
@ -6,6 +6,7 @@ import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
|||
import "package:inventree/app_colors.dart";
|
||||
import "package:inventree/barcode/barcode.dart";
|
||||
import "package:inventree/barcode/purchase_order.dart";
|
||||
import "package:inventree/barcode/stock.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
|
||||
import "package:inventree/inventree/stock.dart";
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
|||
|
||||
import "package:inventree/app_colors.dart";
|
||||
import "package:inventree/barcode/barcode.dart";
|
||||
import "package:inventree/barcode/stock.dart";
|
||||
import "package:inventree/helpers.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
import "package:inventree/api.dart";
|
||||
|
|
@ -436,44 +437,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||
*/
|
||||
Future <void> _transferStockDialog(BuildContext context) async {
|
||||
|
||||
Map<String, dynamic> fields = {
|
||||
"pk": {
|
||||
"parent": "items",
|
||||
"nested": true,
|
||||
"hidden": true,
|
||||
"value": widget.item.pk,
|
||||
},
|
||||
"quantity": {
|
||||
"parent": "items",
|
||||
"nested": true,
|
||||
"value": widget.item.quantity,
|
||||
},
|
||||
"location": {
|
||||
"value": widget.item.locationId,
|
||||
},
|
||||
"status": {
|
||||
"parent": "items",
|
||||
"nested": true,
|
||||
"value": widget.item.status,
|
||||
},
|
||||
"packaging": {
|
||||
"parent": "items",
|
||||
"nested": true,
|
||||
"value": widget.item.packaging,
|
||||
},
|
||||
"notes": {},
|
||||
};
|
||||
|
||||
if (widget.item.isSerialized()) {
|
||||
// Prevent editing of 'quantity' field if the item is serialized
|
||||
fields["quantity"]["hidden"] = true;
|
||||
}
|
||||
|
||||
// Old API does not support these fields
|
||||
if (!api.supportsStockAdjustExtraFields) {
|
||||
fields.remove("packaging");
|
||||
fields.remove("status");
|
||||
}
|
||||
Map<String, dynamic> fields = widget.item.transferFields();
|
||||
|
||||
launchApiForm(
|
||||
context,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue