From 643be98fcf2ef3c9265e59dea3cba109b1874504 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 9 Jul 2014 15:08:29 +0200 Subject: [PATCH] [FIX] models: store FailedValue in cache on log_access fields, too This should fix an issue discovered by tde when reading all fields on a record on which you don't have access right: - _read_from_database() fetches result and store it in cache - read() retrieves values from cache, starting with field 'create_date'... - ... which is not in cache, so prefetch that field, read it, which goes into an infinite loop The problem is that _read_from_database() finds out that you don't have access on the record, and stores a FailedValue in cache on all fields... except magic fields. Fix the problem by storing the FailedValue on all fields but 'id'. --- openerp/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/models.py b/openerp/models.py index 68a9ab64b95..0687e65a1ea 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -5657,7 +5657,7 @@ class RecordCache(MutableMapping): if args and isinstance(args[0], SpecialValue): values = dict.fromkeys(self._recs._ids, args[0]) for name, field in self._recs._fields.iteritems(): - if name not in MAGIC_COLUMNS: + if name != 'id': self._recs.env.cache[field].update(values) else: return super(RecordCache, self).update(*args, **kwargs)