File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 11<odoo >
2-
32 <record id =" action_label_from_record_wizard" model =" ir.actions.act_window" >
43 <field name =" name" >🏷 Imprimer étiquettes produits</field >
54 <field name =" type" >ir.actions.act_window</field >
65 <field name =" res_model" >label.from.record</field >
76 <field name =" view_mode" >form</field >
8- <field name =" view_id" ref =" label_from_record_wizard_view" />
7+ <field name =" view_id" ref =" label_from_record_wizard_view" />
98 <field name =" target" >new</field >
109 </record >
1110
1413 <field name =" inherit_id" ref =" product.product_normal_form_view" />
1514 <field name =" arch" type =" xml" >
1615 <xpath expr =" //header/button" position =" before" >
17- <button string =" 🖨" name =" %(action_label_from_record_wizard)d" type =" action" />
16+ <button
17+ string =" 🖨"
18+ name =" %(action_label_from_record_wizard)d"
19+ type =" action"
20+ />
1821 </xpath >
1922 </field >
2023 </record >
21-
2224</odoo >
Original file line number Diff line number Diff line change @@ -89,7 +89,18 @@ 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 = 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"
99+ "_get_zebra_labels.\n Consider to install "
100+ "'label_helper' module or implements your own "
101+ "behavior in your custom module"
102+ )
103+ )
93104 return {"type" : "ir.actions.act_window_close" }
94105
95106 @api .model
You can’t perform that action at this time.
0 commit comments