Odoo Help


How to disable execution of a function in a function field on update

Soukaina SBITTI
on 2/26/14, 1:01 PM 959 views

I have the following function field:

_columns = {
                store=True,string='Numéro bon de livraison',readonly=True),

the function set_numero_bl implements the field numero_bl with an auto incremented format every time a new record is saved.until here everything works perfectly.

What i want to do, is when a user clicks on some record to modify it,the field numero_bl must keep his old value.

With the code that i have, the field numero_bl (which i remember is readonly) is updated too with a new value(calculated by the function set_numero_bl)

How can i do to make this function executed only on create and not update?

I hope i made it clear. Thank you

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

0 follower(s)


Asked: 2/26/14, 1:01 PM
Seen: 959 times
Last updated: 3/16/15, 8:10 AM