Merge lp:~openerp-community/openobject-server/fix-1094212-multicompany-res_partner into lp:openobject-server/7.0
Proposed by
Niels Huylebroeck
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Xavier ALT | ||||
Approved revision: | 4762 | ||||
Merged at revision: | 4858 | ||||
Proposed branch: | lp:~openerp-community/openobject-server/fix-1094212-multicompany-res_partner | ||||
Merge into: | lp:openobject-server/7.0 | ||||
Diff against target: |
13 lines (+1/-2) 1 file modified
openerp/addons/base/res/res_partner.py (+1/-2) |
||||
To merge this branch: | bzr merge lp:~openerp-community/openobject-server/fix-1094212-multicompany-res_partner | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Fabien (Open ERP) | Needs Fixing | ||
Review via email: mp+141936@code.launchpad.net |
Description of the change
The problem:
The result of cr.execute is bad (why hasn't everyone at openerp been brainwashed yet?) because it will contain results not appropriate for the current user (because of un-applied record rules)
The solution:
After we fetched the result cr.execute I now force the search to be executed (unconditionally) which is no problem even if "args" was not passed (see beginning of function where it is set to [] if it was None). Doing this search it will pass all the ids we have found so far but will also apply the required record rules, thus filtering out the unreadable partner ids in the process.
To post a comment you must log in.
I guess a clean solution would be to completly replace the cr.execute by a self.search, instead of doing two searches. It's also important for performance issues.