From 0f48ca60084ec74b94dcc9b9de244437a6f95161 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 7 Mar 2022 09:48:39 +1100 Subject: [PATCH] Ensure that the native barcode scan plugin is *always* in use --- InvenTree/barcodes/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/InvenTree/barcodes/api.py b/InvenTree/barcodes/api.py index 0d3656ce4c..047db357a4 100644 --- a/InvenTree/barcodes/api.py +++ b/InvenTree/barcodes/api.py @@ -12,6 +12,7 @@ from rest_framework.views import APIView from stock.models import StockItem from stock.serializers import StockItemSerializer +from barcodes.plugins.inventree_barcode import InvenTreeBarcodePlugin from barcodes.barcode import hash_barcode from plugin import registry @@ -57,6 +58,9 @@ class BarcodeScan(APIView): barcode_data = data.get('barcode') + # Ensure that the default barcode handler is installed + plugins.append(InvenTreeBarcodePlugin()) + # Look for a barcode plugin which knows how to deal with this barcode plugin = None