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

Press a button and display a form in a popup, how?

By
E.M.
on 2/9/16, 11:14 AM 660 views

How can you display a popup form when a button is pressed?

Which are the basic steps? Can anyone provide an example?

Thanks,

2
Swapnesh
On 2/9/16, 1:33 PM

Hi E.M,

You can add  button like this in you XML file.

<button name="action_from view" string="Open View" type="object"/> 

You need to define your view here


In Your py


def action_from view(self, cr, uid, ids, context=None):


"Your Code"


        return {

'type': 'ir.actions.act_window',

'view_type': 'form',

'view_mode': 'form',

'res_model': 'mail.compose.message'    # name of respective model,

'views': [(compose_form_id, 'form')],    # view id and type

'view_id': compose_form_id, # view id 

'target': 'new',

'context': context,

}



Thanks

Still basic doubts about how to achieve it: https://www.odoo.com/forum/help-1/question/developing-a-new-popup-in-stock-picking-basic-doubts-about-how-to-generate-the-popup-97625

E.M.
on 2/12/16, 1:07 AM
1
M Grmn
On 2/9/16, 1:37 PM

You can find a very nice explanation in detail on how to do this on stackoverflow

http://stackoverflow.com/questions/31940425/pop-up-the-window-of-exsiting-view-through-click-event-in-odoo

Edit according to your needs.

Still basic doubts about how to achieve it: https://www.odoo.com/forum/help-1/question/developing-a-new-popup-in-stock-picking-basic-doubts-about-how-to-generate-the-popup-97625

E.M.
on 2/12/16, 1:07 AM

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: 2/9/16, 11:14 AM
Seen: 660 times
Last updated: 2/9/16, 1:37 PM