2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 02:35:27 +00:00

New barcode actions (#218)

* Bump release notes

* Adds method for linking custom barcodes

* Custom getter method for determining if an item has barcode data

* Add method to check if the API supports "modern" barcodes

* Refactor custom barcode implementation for StockItem

- Needs testing

* Unit testing for linking and unlinking barcodes

* Fixes

* Refactor code for "custom barcode action" tile

* Add custom barcode action to StockLocation

* Add extra debug to debug the debugging

* Unit test fix

* Change scope I guess?

* remove handler test
This commit is contained in:
Oliver
2022-12-05 23:39:40 +11:00
committed by GitHub
parent efb6fc353e
commit 730521fd00
11 changed files with 162 additions and 134 deletions

View File

@ -4,6 +4,7 @@ import "package:font_awesome_flutter/font_awesome_flutter.dart";
import "package:inventree/api.dart";
import "package:inventree/app_colors.dart";
import "package:inventree/barcode.dart";
import "package:inventree/l10.dart";
import "package:inventree/helpers.dart";
@ -695,35 +696,11 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
)
);
// TODO - Add this action back in once implemented
/*
tiles.add(
ListTile(
title: Text(L10().barcodeScanItem),
leading: FaIcon(FontAwesomeIcons.box),
trailing: Icon(Icons.qr_code),
onTap: () {
// TODO
},
),
);
*/
/*
// TODO: Implement part deletion
if (!part.isActive && InvenTreeAPI().checkPermission("part", "delete")) {
if (InvenTreeAPI().supportModernBarcodes) {
tiles.add(
ListTile(
title: Text(L10().deletePart),
subtitle: Text(L10().deletePartDetail),
leading: FaIcon(FontAwesomeIcons.trashAlt, color: COLOR_DANGER),
onTap: () {
// TODO
},
)
customBarcodeActionTile(context, part.customBarcode, "part", part.pk)
);
}
*/
return tiles;
}