Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Re: Problem with computed default values
by moy lop <moylop260@gmail.com> - 11/04/2016 19:11:37You are using a string into a callable.
You will need a callable into a callable.
Thank you Moses, I tried that (calling the default function in a lambda) but I got the same issue.
I think my solution will be to overwrite create().
/DR
Citando Moises Lopez <moylop260@vauxoo.com>:
Check follow doc:https://github.com/OCA/maintainer-tools/blob/master/CONTRIBUTING.md#fieldSection "defaults"2016-04-11 10:39 GMT-05:00 <Pedro@pad.odoo-community.org>:This exact question was made several weeks ago. Please check in the archives. In a nutshell, you have to execute a pre/post-init hook (the treatment will change depending on the order selected - before or after the installation).Regards.
2016-04-11 17:08 GMT+02:00 Daniel Reis <dgreis@sapo.pt>: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_______________________________________________
Mailing-List: http://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe_______________________________________________
Mailing-List: http://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe--Moisés López Calderón
Vauxoo - OpenERP's Gold Partner
Mobile: (+521) 477-752-22-30
Office: (+52) 477-773-33-46
web: http://www.vauxoo.comtwitter: @vauxoo@moylop260hangout: moylop260@vauxoo.com_______________________________________________
Mailing-List: http://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: http://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe
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