Add POReceiveBarcodeHandler to support barcode/po-receive/ endpoint (#421)

* Add POReceiveBarcodeHandler to support barcode/po-receive/ endpoint

* Remove german translation

* Add api version checks

* Add getOverlayText method to barcode handler

* Bump required API version to 139

* Update barcode.dart

The "quantity" field is not an integer, and can cause the app to crash if not handled correctly

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
Bobbe 2023-10-19 14:28:32 +02:00 committed by GitHub
parent c76309341b
commit 67fd6a564a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 185 additions and 2 deletions

View file

@ -9,6 +9,7 @@ import "package:inventree/widget/purchase_order_detail.dart";
import "package:inventree/widget/refreshable_state.dart";
import "package:inventree/l10.dart";
import "package:inventree/api.dart";
import "package:inventree/barcode/barcode.dart";
import "package:inventree/inventree/purchase_order.dart";
/*
@ -79,6 +80,28 @@ class _PurchaseOrderListWidgetState extends RefreshableState<PurchaseOrderListWi
);
}
@override
List<SpeedDialChild> barcodeButtons(BuildContext context) {
List<SpeedDialChild> actions = [];
if (api.supportsBarcodePOReceiveEndpoint) {
actions.add(
SpeedDialChild(
child: Icon(Icons.barcode_reader),
label: L10().scanReceivedParts,
onTap:() async {
scanBarcode(
context,
handler: POReceiveBarcodeHandler(),
);
},
)
);
}
return actions;
}
@override
Widget getBody(BuildContext context) {
return PaginatedPurchaseOrderList(filters);