Don't validate Function fields without setter

It is a waste of resource to validate such Function fields because the value
doesn't depend on data users enter.
This commit is contained in:
Cédric Krier committed 2010-03-27 15:58:31 +01:00
1 parent d80ac90dda
commit e8f50932e3
1 file changed
+3
+3
View File
@@ -973,6 +973,9 @@ class ModelStorage(Model):
context.update(ctx_pref)
records = self.browse(cursor, user, ids, context=context)
for field_name, field in self._columns.iteritems():
if isinstance(field, fields.Function) and \
not field.setter:
continue
# validate domain
if field._type in ('many2one', 'many2many', 'one2many') \
and field.domain: