Search on many2many with negative operator gives wrong results

Bug #1062795 reported by Stefan Rijnhart (Opener)
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Medium
OpenERP's Framework R&D
Therp Backports (Deprecated)
In Progress
Medium
Stefan Rijnhart (Opener)

Bug Description

When you have a category X and assigned it to one or more partners, it is currently impossible to search for partners that do not have this category.

Steps to reproduce
===============
On a new database,

Create partner A
Create partner B
Create partner C
Create partner AB
Create category A
Create category B
Assign category A to partner A
Assign category B to partner B
Assign both categories A and B to partner AB
Do not assign any categories to partner C

Now search for partner with advanced filter on category 'not equal to' A

Expected results
=============
All partners that are not assigned category A (i.e. partners B and C)

Actual results
===========
All partners that are assigned any category other than A, including partners that also have category A (i.e. partners B and AB)

Related branches

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Medium
status: New → Confirmed
Changed in therp-backports:
assignee: nobody → Stefan Rijnhart (Therp) (stefan-therp)
importance: Undecided → Critical
importance: Critical → Medium
status: New → Triaged
milestone: none → 6.1-maintenance
Revision history for this message
Vo Minh Thu (thu) wrote :

Hi,

I've added some tests, visible in this branch lp:~openerp-dev/openobject-server/trunk-in-not-in-m2m-tests-vmt.

I think I have covered the case you give in this bug report. I can't reproduce your situation.

If you think there is still a problem, please add a test case to examplify it and re-open the bug report (I will close it now).

Changed in openobject-server:
status: Confirmed → Invalid
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Thu,

thank you for adding the test file. I injected the tests that demonstrate the problem in the associated merge request. The tests are validated by the subsequent revisions that add the suggested fix.

Cheers,
Stefan.

Changed in openobject-server:
status: Invalid → New
Lara (Therp) (lfreeke)
Changed in therp-backports:
milestone: 6.1-maintenance → 7.0-maintenance
Changed in therp-backports:
status: Triaged → Fix Committed
Changed in therp-backports:
status: Fix Committed → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.