Skip to content

Commit dc28e65

Browse files
committed
fixup
1 parent dd013fb commit dc28e65

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

label_wizard/wizard/label2print.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,17 @@ def generate_label(self):
8989
if data4print:
9090
model = data4print[0][0].browse(False)
9191
content_params = {"with_price": rec.with_price}
92-
return model._get_zebra_labels(data4print, content_params)
92+
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+
)
93103
return {"type": "ir.actions.act_window_close"}
94104

95105
@api.model

0 commit comments

Comments
 (0)