diff --git a/trytond/model/modelstorage.py b/trytond/model/modelstorage.py index 1779eeac20..c43c0a6721 100644 --- a/trytond/model/modelstorage.py +++ b/trytond/model/modelstorage.py @@ -863,6 +863,10 @@ class ModelStorage(Model): with Transaction().set_user(Transaction().context.get('user')): return cls._validate(cls.browse(records)) + # Ensure that records are readable + with Transaction().set_user(0, set_context=True): + records = cls.browse(records) + for record in records: record.pre_validate() @@ -897,10 +901,6 @@ class ModelStorage(Model): return False with Transaction().set_context(ctx_pref): - # Ensure that records are readable - with Transaction().set_user(0, set_context=True): - records = cls.browse(records) - for field_name, field in cls._fields.iteritems(): if isinstance(field, fields.Function) and \ not field.setter: