Validate Function fields when running tests

This commit is contained in:
Cédric Krier committed 2024-10-08 14:36:13 +02:00
1 parent 6868d72b86
commit 799b8dde56
1 file changed
+6 -1
+6 -1
View File
@@ -1221,6 +1221,11 @@ class ModelStorage(Model):
return
if field._type == 'dict':
return
if (field._type not in {
'many2one', 'one2many', 'many2many', 'one2one',
'reference'}
and not field.searchable(cls)):
return
def get_relation(record):
if field._type in ('many2one', 'one2many'):
@@ -1397,7 +1402,7 @@ class ModelStorage(Model):
and not (field.validation_depends & field_names)
and not (field.validation_depends & function_fields)):
continue
if isinstance(field, fields.Function):
if isinstance(field, fields.Function) and not pool.test:
continue
validate_domain(field)