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.

0

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

By
Soukaina SBITTI
on 2/26/14, 1:01 PM 531 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

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

0 follower(s)

Stats

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