Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Re: Problem with computed default values
by
ClosingAp Open Source Integrators Europe, LDA, Daniel Reis
FYI I used the code below.
Adding an init_hook would be nice, but I'm still evaluating if it's worth the trouble for my use case.
@api.model
def create(self, vals):
vals['token'] = str(uuid.uuid4())
return super(Applicant, self).create(vals)
@api.multi
def write(self, vals):
if len(self) == 1 and not self.token:
vals['token'] = str(uuid.uuid4())
return super(Applicant, self).write(vals)
--
DR
DR
Reference
-
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
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