This question has been flagged
3597 Views

I have the following function field:

_columns = {
    'numero_bl':fields.function(set_numero_bl,method=False,type='char',
                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

Avatar
Discard