Merge lp:~therp-nl/openobject-server/7.0-lp1238042-browse_record_refresh_clear_ids into lp:openobject-server/7.0
Status: | Rejected |
---|---|
Rejected by: | Olivier Dony (Odoo) |
Proposed branch: | lp:~therp-nl/openobject-server/7.0-lp1238042-browse_record_refresh_clear_ids |
Merge into: | lp:openobject-server/7.0 |
Diff against target: |
36 lines (+12/-0) 1 file modified
openerp/osv/orm.py (+12/-0) |
To merge this branch: | bzr merge lp:~therp-nl/openobject-server/7.0-lp1238042-browse_record_refresh_clear_ids |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+190402@code.launchpad.net |
Description of the change
This branch fixes problems with inaccessible record ids ending up in the browse cache when fetching many2one relationships. A read operation is attempted on these records when fetching new data such as function fields or binary fields or any field after a refresh(). Here for example, the parent company with id 3 is inaccessible but a read operation is still attempted on it after it was added when reading its value from the record's parent_id, together will all other plain fields:
(Pdb) co = self.pool.
(Pdb) co.currency_id.id
1
(Pdb) co._data.keys()
[1, 3]
(Pdb) co.street
*** except_orm: (u'Access Denied', u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
This branch solves the problem by filtering out inaccessible records from the cache after values for a many2one field were fetched.
Revno. 5101 is green on runbot.
Unmerged revisions
- 5102. By Stefan Rijnhart (Opener)
-
[RFR] s/o2m/m2o/
- 5101. By Stefan Rijnhart (Opener)
-
[FIX] Bypass model access check to allow for mail.message's bypass of
this mechanism - 5100. By Stefan Rijnhart (Opener)
-
[FIX] Don't _search when superuser, as this causes a loop when records
are browsed as record rules are applied - 5099. By Stefan Rijnhart (Opener)
-
[RFT] Filter out inaccessible ids from the browse record cache
after fetching - 5098. By Stefan Rijnhart (Opener)
-
[RVT] Undo previous change as it does not allow to efficiently fetch
data for a list of browse records (thanks to Olivier Dony for
pointing that out) - 5097. By Stefan Rijnhart (Opener)
-
[FIX] Also fix an additional access error when the id of an inaccessible
record is in the _data dictionary and you ask for the value of
any function field for the first time. - 5096. By Stefan Rijnhart (Opener)
-
[FIX] Don't preserve resource ids when clearing browse record cache, to
prevent access errors after a refresh when the cache contains ids
of unreadable records (for instance, of a parent company)
Make accessing browse records robust against missing keys from
the dictionary because of the first change.
Setting to work in progress as Olivier Dony pointed out that this prevents fetching a list of browse records efficiently.