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 create a Popup for specific button?

By
babu
on 5/14/14, 6:51 AM 2,304 views

In account_asset module when i click the confirm asset button it is show like a popup OK or Cancel, how can i achieve this, give me the suggestions plzzzzzzzzzzzz

Thanks in Advance.

Hello, just add the attribute confirm="" in the xml : <button name="your_xml_act_window_name"  string="My Button"  confirm="Are you sure you wa/>

Thierry Godin
on 6/10/14, 6:08 AM
0

Thierry Godin

--Thierry Godin--
1516
| 8 7 8
Collegien, France
--Thierry Godin--

..

Thierry Godin
On 6/10/14, 6:06 AM

Hello, just add the attribute confirm="" in the xml :

 

 <button name="your_xml_act_window_name"  string="My Button"  confirm="Are you sure you want to delete this stuff???" />

 

EDIT :

Sorry for multiple answer , odoo bugged ?? And a beautiful 500 Error if I try to delete other answers.

0

Thierry Godin

--Thierry Godin--
1516
| 8 7 8
Collegien, France
--Thierry Godin--

..

Thierry Godin
On 6/10/14, 6:06 AM

Hello, just add the attribute confirm="" in the xml :

 

 <button name="your_xml_act_window_name"  string="My Button"  confirm="Are you sure you want to delete this stuff ???" />

0

René Schuster

--René Schuster--
1560
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 5/14/14, 7:04 AM

The return value of your button function should be a window action with target attribute 'new'.

XML:

<button name="your_button_function", string="My Button", type="object"/>

or

 <button name="your_xml_act_window_name", string="My Button"/>

If your button triggers a python function (the 1st case):

def your_button_function:
    return {
        'name': 'My Window',
        'domain': [],
        'res_model': 'my.model',
        'type': 'ir.actions.act_window',
        'view_mode': 'form',
        'view_type': 'form',
        'context': {},
        'target': 'new',
    }

Otherwise: Window Action

0
babu
On 5/15/14, 8:11 AM

Thanks Rene, Have a good day.

Once I click on the button, a popup must appear and ask me whether to proceed or not. Just like it is asking at the time of deleting the record (Do you want to delete the record.).

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: 5/14/14, 6:51 AM
Seen: 2304 times
Last updated: 3/16/15, 8:10 AM