diff --git a/trytond/model/modelstorage.py b/trytond/model/modelstorage.py index 1c5a4c3b7e..3a0000e0b8 100644 --- a/trytond/model/modelstorage.py +++ b/trytond/model/modelstorage.py @@ -81,6 +81,14 @@ def without_check_access(func): return wrapper +def without_rule(func): + @wraps(func) + def wrapper(*args, **kwargs): + with Transaction().set_user(0): + return func(*args, **kwargs) + return wrapper + + def cache_size(): return Transaction().context.get('_record_cache_size', _cache_record) @@ -1038,6 +1046,7 @@ class ModelStorage(Model): @classmethod @without_check_access + @without_rule def _validate(cls, records, field_names=None): pool = Pool() # Ensure that records are readable