Help

How to add confirm dialog box on button or action ?

Closed
Avatar
Jeudy Nicolas

The question has been closed

by
Jeudy Nicolas
on 07/23/2013 13:38:34

I would like to add some confirm box on action or button in OpenERP ? Some customer say it's very easy to validate a purchase order (for example) because no confirm dialog box appear.

How to add this confirm dialog box on some button or action ?

Avatar
Discard
2 Answers
25
Avatar
Lucio
Best Answer

On buttons, at least, you can add a special field called confirm to the definition and that, alone, will do what you want.

For example:

<button name="Name of the button"
    string="Showable label"
    type="object"
    confirm="Are you sure you want to do this?"
/>

This will pop up a confirmation window showing the text "Are you sure you want to do this?".

Easy! :D

Hope it helps you!

1 Comment
Avatar
Discard

If I need to display message with respect to a field, how can i define the value to be asked?

1
Avatar
Yug Faa
Best Answer

As what I do, is creatsng a small wizard with the two Button, one of type special cancel and the other execute a function that will also call the confirm function in the workflow

Example :

<record id="view_cancel_repair" model="ir.ui.view">
    <field name="name">Cancel Repair</field>
    <field name="model">mrp.repair.cancel</field>
    <field name="arch" type="xml">
        <form string="Cancel Repair Order" version="7.0">
            <group>
                <label string="This operation will cancel the Repair process, but will not cancel it's Invoice. Do you want to continue?"/>
            </group>
            <footer>
                <button name="cancel_repair" string="Yes" type="object" class="oe_highlight"/>
                or
                <button string="Cancel" class="oe_link" special="cancel" />
            </footer>
        </form>
    </field>
</record>
3 Comments
Avatar
Discard
Avatar
Samba Faye
-

Yug Faa, can you give enougth informations about how you call you wizard and how you define the classe which manage it??

Avatar
Samba Faye
-

Yug Faa, can you give enougth informations about how you call you wizard and how you define the classe which manage it??

Avatar
Sehrish
-

How to add confirmation box in odoo: https://goo.gl/6P7aR1