feat(label): Add location
This commit is contained in:
parent
8572cccf9f
commit
fbfb35634e
1 changed files with 3 additions and 1 deletions
|
@ -50,7 +50,7 @@ class PhomemoLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin):
|
|||
case 'stockitem':
|
||||
tpart = object_to_print.part
|
||||
barcode = '2' + str(object_to_print.pk)
|
||||
case 'location':
|
||||
case 'stocklocation':
|
||||
tpart = object_to_print
|
||||
barcode = '3' + str(object_to_print.pk)
|
||||
case 'build':
|
||||
|
@ -68,6 +68,8 @@ class PhomemoLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin):
|
|||
'params': tpart.parameters_map() if hasattr(tpart, 'parameters_map') else None,
|
||||
'category': tpart.category.name if hasattr(tpart, 'category') else None,
|
||||
'category_path': tpart.category.pathstring if hasattr(tpart, 'category') else None,
|
||||
'location': tpart.location.name if hasattr(tpart, 'location') else None,
|
||||
'location_path': tpart.location.pathstring if hasattr(tpart, 'location') else None,
|
||||
'barcode': barcode,
|
||||
'type': kwargs['label_instance'].SUBDIR
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue