Merge lp:~openerp-dev/openobject-server/7.0-opw-592890SearchOnTranlslatebleField-msh into lp:openobject-server/7.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-server/7.0-opw-592890SearchOnTranlslatebleField-msh |
Merge into: | lp:openobject-server/7.0 |
Diff against target: |
54 lines (+13/-18) 1 file modified
openerp/osv/expression.py (+13/-18) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/7.0-opw-592890SearchOnTranlslatebleField-msh |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Trigaux (OpenERP) | Pending | ||
Olivier Dony (Odoo) | Pending | ||
Naresh(OpenERP) | Pending | ||
Review via email: mp+167495@code.launchpad.net |
Description of the change
Hello,
Fixed the issue of no other operator supported in advance search(except contains) if language is other then english for translated field.
Demo:- Install german language -> use german language -> go to supplier listview(to face this issue add/show country field in listview), add advance filter with Land, enthalt nicht(doesn't contains) and value(say for example Belgien)
Result: It doesn't give resule according to filter applied, even though we filter that doesn't contains Belgien still it will give records with Belgien.
Reason: It is due to expression parsing, if field is translateable then we make UNION of res_id from it_translation and same string we search in current working table(i.e. records from currenct working table where filed value not Belgien, in working table field value always be in English source language).
Fixed the issue by making virtual table using WITH query with LEFT JOIN ir_tranlsations, this way we will be able to search on translated field with whole string as well as part of a tranlsated string.
Thanks.