From ddaadd1398510eeb2e49902218a77288ce848b3c Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Fri, 3 Aug 2012 11:48:00 +0200 Subject: [PATCH] [FIX] orm: disallow LOG_ACCESS fields in the create() method. Removes the LOG_ACCESS fields from the values given to create(), otherwise we would end up passing two times the same field to postgresql. bzr revid: vmt@openerp.com-20120803094800-81cgwyeg5cmud9mj --- openerp/osv/orm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index a1a267bd552..03728edae2a 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -4160,6 +4160,12 @@ class BaseModel(object): self.check_create(cr, user) + if self._log_access: + for f in LOG_ACCESS_COLUMNS: + if vals.pop(f, None) is not None: + _logger.warning( + 'Field `%s` is not allowed when creating the model `%s`.', + f, self._name) vals = self._add_missing_default_values(cr, user, vals, context) tocreate = {}