Merge lp:~openerp-dev/openobject-server/7.0-opw-592482-rha into lp:openobject-server/7.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-server/7.0-opw-592482-rha |
Merge into: | lp:openobject-server/7.0 |
Diff against target: |
24 lines (+3/-2) 1 file modified
openerp/addons/base/res/res_company.py (+3/-2) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/7.0-opw-592482-rha |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guewen Baconnier @ Camptocamp (community) | Approve | ||
Naresh(OpenERP) | Pending | ||
Review via email: mp+167466@code.launchpad.net |
Description of the change
Replaced browse return user.company_id.id by read() in _company_
This causes performance issue as browse call will read all the fields' value for company, partner and user and specifically when a big image uploaded for any user.
_company_
will not going to read all the fields and save time.
Unmerged revisions
- 4998. By Guewen Baconnier @ Camptocamp <email address hidden>
-
[FIX] res_comapy: prevent browse of user.company_id by read() in _company_
default_ get(),
this can cause performance issue as browse call will read all the m2o filds for company, partner and user and specificallly an big image and that
kills performance
That's an acceptable mitigation of the performance penalty inflicted by large binary (image) on a user for the stable version. A better solution for the trunk is to not pre-fetch the binary files in the browse_records.
The browse_record will be fetched (so with the image) only if a rule needs to consume it. Otherwise, only a read on the company_id will be done. -> Probably most of the cases won't read the binary.
More details in the discussion of the bug report: https:/ /bugs.launchpad .net/openobject -server/ +bug/1177965
Thanks