[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
This commit is contained in:
Vo Minh Thu
2012-08-03 11:48:00 +02:00
parent c50a0dcf9a
commit ddaadd1398
+6
View File
@@ -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 = {}