Ensure records are readable also for constraints
review595004
This commit is contained in:
1 parent
9f916c1391
commit
1cdf1ffaef
1 file changed
+4
-4
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user