Don't create inherit record if value is also in base model and if it is a

function field.
This commit is contained in:
Cédric Krier committed 2009-04-05 18:10:25 +02:00
1 parent eaeb6be83b
commit 00bfaf5199
1 file changed
+5 -2
+5 -2
View File
@@ -262,9 +262,12 @@ class ModelSQL(ModelStorage):
for i in values.keys():
if i in self._inherit_fields:
(inherits, col, col_detail) = self._inherit_fields[i]
if i in self._columns and isinstance(col_detail, fields.Function):
continue
tocreate.setdefault(inherits, {})
tocreate[inherits][i] = values[i]
#XXX add check if field is not also on base model
del values[i]
if i not in self._columns:
del values[i]
for inherits in tocreate:
inherits_obj = self.pool.get(inherits)