[FIX] models: access error due to prefetch of indirectly referenced records
Complements commitaf9393d505in light of commit62b0d99cfe, 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:
+1
-1
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user