We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dd013fb commit dc28e65Copy full SHA for dc28e65
label_wizard/wizard/label2print.py
@@ -89,7 +89,17 @@ def generate_label(self):
89
if data4print:
90
model = data4print[0][0].browse(False)
91
content_params = {"with_price": rec.with_price}
92
- return model._get_zebra_labels(data4print, content_params)
+ method = getattr(model, "_get_zebra_labels")
93
+ if method:
94
+ return method(data4print, content_params)
95
+ else:
96
+ raise UserError(
97
+ _(
98
+ f"Model {model._name} has no attribute _get_zebra_labels."
99
+ "\nConsider to install 'label_helper' module or"
100
+ " implements your own behavior in your custom module"
101
+ )
102
103
return {"type": "ir.actions.act_window_close"}
104
105
@api.model
0 commit comments