Skip to Content
Menu
This question has been flagged
1 Reply
4817 Views

Please help to configure below. Below snippet I got from Zpl2 add-on.

1) How I can add actwindow in product.template

<act_window id="action_wizard_purchase"
name="Print Label"
src_model="product.product"
res_model="wizard.print.record.label"
view_mode="form"
target="new"
key2="client_action_multi"/>
2) How I can add Print label in product.template print action
# Example : Print the label of a product
self.env['printing.label.zpl2'].browse(label_id).print_label(
self.env['printing.printer'].browse(printer_id),
self.env['product.product'].browse(product_id))
Avatar
Discard
Best Answer


1) Create action for your wizard and define it in the value(2nd record)

    <record id="your_wizard_action_id" model="ir.actions.act_window">

        <field name="name">Create Group</field>

        <field name="res_model">wizard.name</field>

        <field name="view_mode">form</field>

        <field name="target">new</field>

    </record>



    <record model="ir.values" id="action_if_in_product">

        <field name="name">Action Name</field>

        <field name="key2">client_action_multi</field>

        <field name="value" eval="'ir.actions.act_window,' +str(ref('your_wizard_action_id'))" />

        <field name="key">action</field>

        <field name="model">Product.template</field>

    </record>



Avatar
Discard
Related Posts Replies Views Activity
2
Jul 22
7403
1
Jun 21
1058
2
Feb 21
299
5
Sep 20
12740
4
Jun 20
48215