changeset b799fb16468d in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=b799fb16468d
description:
Ensure to read only validated records
The list of records can be part of a large browse list which may be
also read
when accessing attribute of the record. To prevent that we must use a
new
browsing list.
issue10632
review334631003
diffstat:
trytond/model/modelstorage.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diffs (14 lines):
diff -r 9cc55cca68b0 -r b799fb16468d trytond/model/modelstorage.py
--- a/trytond/model/modelstorage.py Thu Aug 12 18:38:15 2021 +0200
+++ b/trytond/model/modelstorage.py Mon Aug 16 23:07:06 2021 +0200
@@ -1056,7 +1056,9 @@
@without_check_access
def _validate(cls, records, field_names=None):
pool = Pool()
- records = list(records) # convert iterator to list
+ # Ensure only records to validate are read,
+ # also convert iterator to list
+ records = cls.browse(records)
ctx_pref = {}
if Transaction().user: