From 082b5d1c803f564a2da6fcf7c01aaab14efb06e6 Mon Sep 17 00:00:00 2001 From: Bobbe <34186858+30350n@users.noreply.github.com> Date: Thu, 11 Jan 2024 23:37:04 +0100 Subject: [PATCH] Fix reassigning supplier barcodes (#6162) * Ignore 3rd party barcode plugins when assigning barcode * Use single quotes --- InvenTree/plugin/base/barcodes/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/InvenTree/plugin/base/barcodes/api.py b/InvenTree/plugin/base/barcodes/api.py index 41ee0fc637..64f4304c04 100644 --- a/InvenTree/plugin/base/barcodes/api.py +++ b/InvenTree/plugin/base/barcodes/api.py @@ -144,15 +144,15 @@ class BarcodeAssign(BarcodeView): Checks inputs and assign barcode (hash) to StockItem. """ # Here we only check against 'InvenTree' plugins - plugins = registry.with_mixin('barcode', builtin=True) + inventree_barcode_plugin = registry.get_plugin('inventreebarcode') # First check if the provided barcode matches an existing database entry - for plugin in plugins: - result = plugin.scan(barcode) + if inventree_barcode_plugin: + result = inventree_barcode_plugin.scan(barcode) if result is not None: result['error'] = _('Barcode matches existing item') - result['plugin'] = plugin.name + result['plugin'] = inventree_barcode_plugin.name result['barcode_data'] = barcode raise ValidationError(result)