Odoo Help


Run javascript in a popup

on 11/19/14, 10:49 AM 1,319 views

I read this documentation

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>

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"

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>            

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 11/19/14, 10:49 AM
Seen: 1319 times
Last updated: 4/21/16, 6:29 PM