Get default value for inherited field only if there is a default method for issue2027

This commit is contained in:
Cédric Krier committed 2011-05-31 10:49:38 +02:00
1 parent 6a828d81ad
commit 175fb9cd0f
1 file changed
+3 -2
+3 -2
View File
@@ -253,8 +253,9 @@ class ModelSQL(ModelStorage):
'write_uid', 'write_date'):
default.append(i)
for i in self._inherit_fields.keys():
if (not i in values) \
and (not self._inherit_fields[i][0] in avoid_table):
if ((not i in values)
and (not self._inherit_fields[i][0] in avoid_table)
and i in self._defaults):
default.append(i)
if len(default):