mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix reassigning supplier barcodes (#6162)
* Ignore 3rd party barcode plugins when assigning barcode * Use single quotes
This commit is contained in:
parent
7f231cb6c1
commit
082b5d1c80
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user