odoo/openerp/addons/test_new_api
Christophe Simonis af9393d505 [FIX] orm: access error due to prefetch of indirectly referenced records.
The new-api record prefetching algorithm attempts
to load data for all known records from the requested
model (i.e. all IDs present in the environment cache),
regardless of how indirectly/remotely they were
referenced. An indirect parent record may therefore
be prefetched along with its directly browsed children,
possibly crossing company boundaries involuntarily.

This patch implements a fallback mechanism when
the prefetching failed due to what looks like an
ACL restriction.

The implementation of `_read_from_database` handle
ACL directly and set an `AccessError` as cache value
for restricted records.

If a model (like `mail.message`) overwrites `read` to
implements its own ACL checks and raises an `AccessError`
before calling `super()` (which will then call
`_read_from_database`), the cache will be not fill,
leading to an unexpected exception.

If this commit messae looks familiar to you, that's
simply because this is the new-api counterpart of
b7865502e4
2015-07-24 14:01:09 +02:00
..
tests [FIX] orm: access error due to prefetch of indirectly referenced records. 2015-07-24 14:01:09 +02:00
__init__.py [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
__openerp__.py [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
demo_data.xml [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
ir.model.access.csv [IMP] test_new_api: move test on delegate=True to module test_inherit 2015-02-18 16:43:20 +01:00
models.py [FIX] orm: access error due to prefetch of indirectly referenced records. 2015-07-24 14:01:09 +02:00
views.xml [FIX] test_new_api: missing parent menu 2014-08-14 16:48:32 +02:00