[5.0] one2many field domain 'in' empty list incorrectly returns records
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
There is a bug in expression.py when evaluating 'in' conditions for empty lists [] on one2many fields. It returns a list of non-matching ids instead of the expected empty list.
This is similar to bug #651999: Regression: many2one search operator 'in'
It is possible to see this bug using standard modules and the openobject object model:
1. install base_contact module
2. Add some contacts that are not attached to a company
3. Create a company that doesn't have any contacts
4. Now run a search for contacts in the company you created that does not have any. e.g. by running the following API call:
self.pool.
Instead of an empty list, you will actually get the IDs of all contacts that are NOT a member of a company!
Its a simple code fix. In the latest expression.py (rev 2138) on line 188:
Replace:
if right:
with:
if right or (right==[]):
Duplicate of https:/ /bugs.launchpad .net/openobject -server/ +bug/626806.
Please see details on it.