Merge lp://qastaging/~openerp-dev/openobject-server/trunk-opw-581385-port-cha into lp://qastaging/openobject-server
Status: | Needs review |
---|---|
Proposed branch: | lp://qastaging/~openerp-dev/openobject-server/trunk-opw-581385-port-cha |
Merge into: | lp://qastaging/openobject-server |
Diff against target: |
27 lines (+7/-3) 1 file modified
openerp/osv/expression.py (+7/-3) |
To merge this branch: | bzr merge lp://qastaging/~openerp-dev/openobject-server/trunk-opw-581385-port-cha |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+138428@code.qastaging.launchpad.net |
Description of the change
Hello,
The bug that was encountered: When using the negative operators in advanced filters, wrong results were shown when the language was not set to english
The reason: If you search, for example, for countries that are not "Belgique", a union between the countries that do not have "Belgique" as original value and that do not have "Belgique" as french translation is made. This is incorrect, since it will return all the countries. This was done to allow the user to search using both the original value "Belgium" and the translated value "Belgique", and it works fine for the positive operators (in which case the union makes perfect sense), but not for the negative operators.
The fix: When using negative operators, an intersection must be used instead of a union.
-> Countries that are called "Belgique" OR whose translated value is "Belgique": Union
-> Countries that are not called "Belgique" AND whose translation is not "Belgique": Intersection
-> In logic: NOT(a OR b) == NOT a AND not b
Code is forward port from 6.1
Thanks,
Ajay Chauhan
Unmerged revisions
- 4644. By Ajay Chauhan(OpenERP)
-
[MERGE] merge with lp:openobject-server
- 4643. By Chris Biersbach (OpenERP)
-
[FIX] This fixes incorrect behavior of of advanced search filters containing negative operators on translated fields