Odoo Help


This community 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.


Run javascript in a popup

on 11/19/14, 10:49 AM 703 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


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