From 00bfaf51996e3329a904e300de166babbf6d2363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 5 Apr 2009 18:10:25 +0200 Subject: [PATCH] Don't create inherit record if value is also in base model and if it is a function field. --- trytond/model/modelsql.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py index a532c9fd08..35b375fe5e 100644 --- a/trytond/model/modelsql.py +++ b/trytond/model/modelsql.py @@ -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)