Hello, I am developing a new module in Odoo 8.
I need to display a confirm message (I see that I can do this adding the confirm="confirm message" in button XML) from the Python code, in a method.
For example: I override the create method of sale.order model. I want to check if the total of the sale is under X value. If the value > X, I display a confirm message like "Do you really confirm this sale?" and catch the button pressed for the user to decide what action I do.
AFAIK, this is a feature lacking in Odoo. If you want to stop the processing forward (not a confirmation but a validation that stops the processing from moving forward) you can raise an exception. But I am not aware of anyway to display a confirmation message that user can choose to go forward or not. You can display a warning message using on_change (e.g. when the sale order line is changed, trap it using on_change, then calculate the total sales value and if it is more than X, then display a warning message).
Yes you can do that.. using a wizzard
This approach needs the method to be split in parts (before,during and after wizard)
Steps you need to do
1. create you custom method, make some computation/data colection
;then create a record in transient model and return wizard wiev for created record
2. in wizard display whatever user needs to make a choice
3. accoring to choice continue or cancel futrher actions...
hope it helps....
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
|Asked: 12/22/14, 2:32 PM|
|Seen: 1909 times|
|Last updated: 3/16/15, 8:10 AM|