Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Problem with computed default values
by
ClosingAp Open Source Integrators Europe, LDA, Daniel Reis
Hello all, I'm in need of some expert help. I added a field to a model, to be used as a random unique identifier: token = fields.Char('Token', default=lambda s: str(uuid.uuid4())) The problem is that, the already existing records all got the same exact uuid. It seems that the lambda is evaluated once, before a mass update, instead of per record, as I expected. Am I missing something? Thanks for any help. -- Daniel Reis
Follow-Ups
-
Re: Problem with computed default values
byClosingAp Open Source Integrators Europe, LDA, Daniel Reis -
Re: Problem with computed default values
byClosingAp Open Source Integrators Europe, LDA, Daniel Reis -
Re: Problem with computed default values
byClosingAp Open Source Integrators Europe, LDA, Daniel Reis -
Re: Problem with computed default values
byTecnativa. S. L., Pedro M. Baeza -
Re: Problem with computed default values
byGroupement Régional Alimentaire de Proximité, Sylvain LE GAL