Odoo Help


Is the 'Write' function always called when I click a button ? (V7)

Pierre Beghin
on 3/6/15, 4:45 AM 779 views

If I add a button of type 'object' on a form in order to call a custom python procedure, the write function is always called before my procedure is called.

I need a way to bypass the write and just call my procedure.

I tried to put some info in the context declaration of the button, but the context is not passed to the write function, only to my procedure.

Is there something I am missing?






| 5 3 8
Pondicherry, India
On 3/6/15, 8:26 AM


When you click the button , first it triggers the write method and save the record and then proceed other things.

you can get your answer in the following links:



Pierre Beghin
On 3/6/15, 8:55 AM

Thank you Vasanth.

So it seem that triggering the write method cannot be avoided, isnt'it ?

Do you know a way to provide some context to the write method ?

As I tried, giving a context to the button will only forward it to the referred method, not to the write one.

ex: <button string="Do something" name="do_something" type="object" context="{'some_info':'any'}"/>

will indeed call the python do_something() method with the required 'some_info' in the context.

Unfortunately, the write method that is triggered before doesn't receive the 'some_info' parameter in its context !

In a word, I try to trigger a method that does some computation with the values in the form, before they get saved.

An idea ?


About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/6/15, 4:45 AM
Seen: 779 times
Last updated: 3/16/15, 8:10 AM