[FIX] models: access error due to prefetch of indirectly referenced records

Complements commit af9393d505
in light of commit 62b0d99cfe,
to really have the correct effect.

When the prefetching failed due to the presence of
extra records in the cache (for which the access is denied),
the `read` operation was indeed retried. However the
result was not stored in the cache because the cache
already held a FailedValue (automatically added when the
prefetch failed).
This commit is contained in:
Olivier Dony 2015-07-31 18:24:46 +02:00
parent d1d4688521
commit df002518ee
1 changed files with 1 additions and 1 deletions

View File

@ -3234,7 +3234,7 @@ class BaseModel(object):
result = self.read(list(fnames), load='_classic_write')
# check the cache, and update it if necessary
if not self._cache.contains(field):
if field not in self._cache:
for values in result:
record = self.browse(values.pop('id'))
record._cache.update(record._convert_to_cache(values, validate=False))