fix(label): Add type info to label

This commit is contained in:
Andreas Mieke 2024-04-20 21:58:33 -04:00
parent 43c5c8a5ba
commit fdea2b70d1
Signed by: zenermerps
SSH key fingerprint: SHA256:Ne+hwc5QIgYlqCuLZ0LV3301Wo/p8UoGOrGC+T6S0t8

View file

@ -59,7 +59,7 @@ class PhomemoLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin):
case _:
tpart = object_to_print
barcode = '0' + str(object_to_print.pk)
print(f"!! Unsupported item type: {object_to_print.SUBDIR}")
print(f"!! Unsupported item type: {kwargs['label_instance'].SUBDIR}")
fields = {
'name': tpart.name,
@ -68,7 +68,8 @@ class PhomemoLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin):
'params': tpart.parameters_map(),
'category': tpart.category.name,
'category_path': tpart.category.pathstring,
'barcode': barcode
'barcode': barcode,
'type': kwargs['label_instance'].SUBDIR
}
data = json.dumps(fields)