Odoo Help


Open a popup form in create mode

Emanuel Cino
on 11/11/14, 7:16 AM 3,718 views

I added a button in crm.lead form in order to create a new object I defined based on the values of the Lead. I successfully can open a form in a popup (target=new) with predefined values (using the context and default_ values). However, there is no Create button showing up, I can therefore not save my new record. Do you know how to add this Create button ? Here is my XML:

<!-- Create Event action -->
        <record id="action_crm_make_event" model="ir.actions.act_window">
          <field name="name">Create Event</field>
          <field name="type">ir.actions.act_window</field>
          <field name="res_model">crm.event.custom</field>
          <field name="view_type">form</field>
          <field name="view_mode">form</field>
          <field name="target">new</field>

<!-- Button for creating event based on existing Lead -->

<button string="Create Event" name="%(action_crm_make_event)d" type="action"

                 context="{'default_name': name, ...}"/>




| 4 4 6
Hyderabad, India

On 1/24/15, 10:59 AM

I too faced this problem so i did some Research on this and came up with the solution in view.js file under web module:

at line  384, after "

 action.flags = _.defaults(action.flags || {}, {

            views_switcher : !popup && !inline,
            search_view : !popup && !inline,
            action_buttons : !popup && !inline,
            sidebar : !popup && !inline,
            pager : (!popup || !form) && !inline,
            display_title : !popup,
            search_disable_custom_filters: action.context && action.context.search_disable_custom_filters

ADD this line: 

"if (popup){
            action.flags.action_buttons = true;

This will show "save" and "Discard" buttons on 'target:new'.

Hope this will help you.

On 11/11/14, 9:15 AM


Please add one object button with any name except "create" (prefferable) in the form of "crm.event.custom" and in the method just retun True.

It should save the details of that pop up form.

It will work, try it.

This will add the button in the form of the "crm.event.custom". However, if I go on the form view without coming from the "crm.lead" object", I don't want to see this button, as I am not in a popup mode...

Emanuel Cino
on 11/11/14, 9:48 AM

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/11/14, 7:16 AM
Seen: 3718 times
Last updated: 3/14/16, 5:06 AM