Sharifah
Sharifah

Reputation: 361

Yes/No message box in Odoo

I would like to show a message box with 'text', 'Yes' and 'No' button. If users click 'Yes', to continue the method work.

How could I add this alert message box in my Odoo by Python?

If you have any idea, please share me.

Thanks.

Upvotes: 0

Views: 4019

Answers (2)

Akhil Mathew
Akhil Mathew

Reputation: 1659

You can do one thing. Call a form view using button (type="action"). In form view footer, keep your button. On clicking on the button do your desired operation.

NB: Your form view model should be different. Should not be same as current view.

Upvotes: 0

no coder
no coder

Reputation: 2290

If you're looking to do it via button you can use confirm attribute in xml.

<button name="cancel_voucher" string="Cancel Voucher" type="object" states="posted" confirm="Are you sure you want to unreconcile this record?"/>

Upvotes: 3

Related Questions