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.

3

Warn user before cancelling a quotation.

By
Lawrence
on 3/28/13, 1:03 PM 1,258 views

Hello,

Is there an easy way to implement a warning whereby the user is asked 'Are you sure you want to cancel this quotation?' before actually cancelling it?

It is very easy to hit cancel when actually just wanting to go back to list view from form view! As far as I can tell there is no easy way to undo that action.

Thanks, Lawrence

8

Andreas Brueckl

--Andreas Brueckl--
5056
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 3/28/13, 3:16 PM

For buttons there exists the attribute confirm. When this attribute is set, then when the button is pressed a dialog box appears before the action is processed.

In the case of the Sales Quotation you can change the following line of the form view to implement a dialog box:

 <button name="cancel" states="draft,sent" string="Cancel" groups="base.group_user"/>

to

 <button name="cancel" states="draft,sent" string="Cancel" confirm="Are you sure you want to cancel this quotation?" groups="base.group_user"/>

image description

Hi Andreas, thank you for this excellent answer. I am hoping to put this modification into a patch (so that I do not need to make the change each time I update the code). If you are able to help, please see http://help.openerp.com/question/27344/is-there-a-beginners-guide-to-writing-a-patch/. Thanks!

Lawrence
on 8/7/13, 9:12 AM

I have read into this some more and the way to ensure that changes remain even after updating is to create a new view which inherits the existing view.

Lawrence
on 2/25/14, 6:52 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: 3/28/13, 1:03 PM
Seen: 1258 times
Last updated: 3/16/15, 8:10 AM