This question has been flagged
3526 Views

I read this documentation
https://doc.odoo.com/trunk/web/module/

And I have this action

    <record model="ir.actions.client" id="action_client_example">
        <field name="name">Example Client Action</field>
        <field name="tag">example.action</field>
    </record>


The action run this code in javascript

    openerp.mail_extended = function (instance) {
        instance.web.client_actions.add('example.action', 'instance.mail_extended.action');
        instance.mail_extended.action = function (parent, action) {
            console.log("Executed the action", action);
        };
    };


I only can run this pressing the button in the menu

    <menuitem action="action_client_example"
              id="menu_client_example"/>


But I want to run the code in this wizard (or similar):

    <record id="action_wizard_gallery" model="ir.actions.act_window" >
        <field name="name">Galeria</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">res.partner</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="email_template_gallery_image_form_view" />
        <field name="target" >new</field>            
    </record>

I open this wizard with this button

<button name="%(mail_extended.action_wizard_gallery)d" type="action" class="oe_button oe_form_button" string="Abrir"  />

How can I do this?

Many thank in advance

Avatar
Discard