Odoo Help

Welcome!

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.

0

How to show the cancel/save buttons on a popup form

By
Anuradha
on 8/31/13, 7:00 AM 8,155 views

How to show the cancel/save buttons on a popup form?

7
laribi
On 10/17/13, 8:54 AM

Add this te the xml form :

<footer> <button name="write" type="object" string="Save"/> or <button name="cancel" string="Cancel" special="cancel" class="oe_link"/> </footer>

is the "write" function available in all py files???

Atchuthan - Technical Consultant, Sodexis Inc
on 10/18/13, 2:51 AM

Yes and you can redefine it by ( def write ....)

laribi
on 10/18/13, 7:09 AM
1
Jamshid Chungath
On 8/1/15, 3:10 AM

after target:'new'

add these

'flags': {'form': {'action_buttons': True}}

1

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 8/31/13, 7:03 AM

When you open a record in modify state, all the popup has got cancel/save button

i am passing form from py file. i want to see save button in pop up buts its not showing my code is return { 'type': 'ir.actions.act_window', 'name': 'Form heading', 'view_mode': 'form', 'view_type': 'form', # 'view_id': view_id, 'res_model': 'calldata1', 'nodestroy': True, #'res_id': this.id, # assuming the many2one

'target':'new',

          'context': context,
}
Anuradha
on 8/31/13, 7:05 AM
0
Fernando Gomes
On 5/5/16, 7:28 PM

Hello All,

When I add the 'flags': {'form': {'action_buttons': True}} to the return values I do get the Save and Cancel buttons but the Cancel button does nothing and the Save button saves but does not close the popup window.Is there anyway to add some more values / attributes to the return list so that the popup would act just like the "Create and Edit..." of a M2M field?

Thanks,

Fernando

0

Pawan

--Pawan--
1267
| 4 3 5
Hyderabad, India
--Pawan--


Pawan
On 1/24/15, 10:45 AM

I am new to Openerp and also faced the same problem you are facing.

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.

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

1 follower(s)

Stats

Asked: 8/31/13, 7:00 AM
Seen: 8155 times
Last updated: 12/2/16, 2:23 AM