From 799b8dde56a43cb92d4ecfe8a0f5dd967e4956d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 8 Oct 2024 14:36:13 +0200 Subject: [PATCH] Validate Function fields when running tests --- trytond/trytond/model/modelstorage.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/model/modelstorage.py b/trytond/trytond/model/modelstorage.py index 934e1af222..28f771d11d 100644 --- a/trytond/trytond/model/modelstorage.py +++ b/trytond/trytond/model/modelstorage.py @@ -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)