odoo/openerp/addons/test_new_api/tests
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
..
__init__.py [FIX] remove deprecated checks/fast_suite test attributes from standard modules 2015-01-15 14:31:40 +01:00
test_attributes.py [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
test_field_conversions.py [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
test_new_fields.py [FIX] orm: access error due to prefetch of indirectly referenced records. 2015-07-24 14:01:09 +02:00
test_onchange.py [FIX] models: in onchange, false changes where detected in many2many fields 2015-02-21 11:29:13 +01:00
test_related.py [IMP] models: convert deprecated model._all_columns into a dynamic property 2015-03-23 14:36:14 +01:00