tuple (5) to unlink all values in a many2many field doesn't work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP's Framework R&D |
Bug Description
According to the doc : http://
There is a command to unlink all targets of a m2m field :
(5) unlink all (like using (3,ID) for all linked records)
According to openobject-
elif act[0] == 5:
This code leads to the following request :
update my_own_
This request is not correct, it leads to an UPDATE 0 each time. It should be :
update my_own_
So the correct code could be :
But this is still false !
In the case of a many2many field, we have a separate table dedicated to linking the target values to the source field. So the correct request should be:
delete from my_own_
Thus the correct code should be something like:
Related branches
- Naresh(OpenERP): Pending requested
-
Diff: 12 lines (+1/-1)1 file modifiedopenerp/osv/fields.py (+1/-1)
- Naresh(OpenERP): Pending requested
-
Diff: 12 lines (+1/-1)1 file modifiedbin/osv/fields.py (+1/-1)
Changed in openobject-server: | |
assignee: | nobody → OpenERP's Framework R&D (openerp-dev-framework) |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in openobject-server: | |
status: | Confirmed → Fix Committed |
information type: | Public → Private |
Fix landed in trunk at revno 3599 (revision-id: <email address hidden>)
Thanks for the bug report!