mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Stock barcode fix (#232)
* API: Provide more info in error messages * Fix support for legacy stock item custom barcodes * Refresh display after assigning barcode * Update release notes * Fix for scanning unkown barcode - Modern API returns slightly different data * Fix for scanning unkown barcode - Modern API returns slightly different data * Update release notes
This commit is contained in:
parent
27040024c0
commit
d2b74e7684
7 changed files with 54 additions and 18 deletions
|
|
@ -802,10 +802,23 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||
)
|
||||
);
|
||||
|
||||
if (InvenTreeAPI().supportModernBarcodes) {
|
||||
tiles.add(customBarcodeActionTile(context, item.customBarcode, "stockitem", item.pk));
|
||||
if (InvenTreeAPI().supportModernBarcodes || item.customBarcode.isEmpty) {
|
||||
tiles.add(customBarcodeActionTile(context, this, item.customBarcode, "stockitem", item.pk));
|
||||
} else {
|
||||
// Note: Custom legacy barcodes (only for StockItem model) are handled differently
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().barcodeUnassign),
|
||||
leading: Icon(Icons.qr_code, color: COLOR_CLICK),
|
||||
onTap: () async {
|
||||
await item.update(values: {"uid": ""});
|
||||
refresh(context);
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Print label (if label printing plugins exist)
|
||||
if (labels.isNotEmpty) {
|
||||
tiles.add(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue