plugins: Remove custom barcode plugin
This commit is contained in:
parent
beb4a7fa6b
commit
22c0929b5b
1 changed files with 0 additions and 25 deletions
|
|
@ -1,25 +0,0 @@
|
|||
from plugin import InvenTreePlugin
|
||||
from plugin.mixins import BarcodeMixin
|
||||
from part.models import Part
|
||||
import structlog
|
||||
|
||||
logger = structlog.get_logger("ctbk.barcode")
|
||||
|
||||
|
||||
class CtbkBarcodePlugin(BarcodeMixin, InvenTreePlugin):
|
||||
TITLE = "CTBK IPN Barcode Plugin"
|
||||
NAME = "ctbk-ipn-barcode-plugin"
|
||||
DESCRIPTION = "Supports the CTBK IPN format directly in barcodes"
|
||||
VERSION = "0.0.1"
|
||||
AUTHOR = "kleines Filmröllchen"
|
||||
|
||||
def scan(self, barcode_data):
|
||||
if barcode_data.startswith("963e5440-"):
|
||||
try:
|
||||
instance = Part.objects.get(IPN=barcode_data.strip())
|
||||
label = Part.barcode_model_type()
|
||||
|
||||
return {label: instance.format_matched_response()}
|
||||
except Part.DoesNotExist:
|
||||
logger.error("could not find a part for barcode %s", barcode_data)
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue