fix(label): Check if attributes exist
This commit is contained in:
parent
fdea2b70d1
commit
8572cccf9f
1 changed files with 3 additions and 3 deletions
|
@ -65,9 +65,9 @@ class PhomemoLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin):
|
||||||
'name': tpart.name,
|
'name': tpart.name,
|
||||||
'description': tpart.description,
|
'description': tpart.description,
|
||||||
'pk': tpart.pk,
|
'pk': tpart.pk,
|
||||||
'params': tpart.parameters_map(),
|
'params': tpart.parameters_map() if hasattr(tpart, 'parameters_map') else None,
|
||||||
'category': tpart.category.name,
|
'category': tpart.category.name if hasattr(tpart, 'category') else None,
|
||||||
'category_path': tpart.category.pathstring,
|
'category_path': tpart.category.pathstring if hasattr(tpart, 'category') else None,
|
||||||
'barcode': barcode,
|
'barcode': barcode,
|
||||||
'type': kwargs['label_instance'].SUBDIR
|
'type': kwargs['label_instance'].SUBDIR
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue