Data corruption: fields.related writes to the target model with source id
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Medium
|
OpenERP's Framework R&D | ||
Therp Backports (Deprecated) |
Fix Released
|
High
|
Stefan Rijnhart (Opener) | ||
Server-6.1 |
New
|
Undecided
|
Unassigned | ||
Server-7.0 |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
Problem:
------------
A fields.related with type='many2many' tries to write to the target model but with id of the source model in case the original value of the many2many field on the target resource is empty.
Analysis:
-----------
Take for example a column definition in osv class 'source.model':
'related_
A value is written to this field. The current value on the target model is empty.
The method related.
Although the code is a bit difficult to read, you can check that *if* the current value of the field (t_data[
Result:
---------
If a resource exists with this id, the new value get silently written to this wrong resource. If such a resource does not exist, the following error occurs: "'One of the records you are trying to modify has already been deleted".
This problem occurs on openerp-server/6.0 (rev. 3565). Trunk has not been tested, but the function in which the problem occurs has remained unchanged.
[1] http://
[2] http://
[3] http://
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 33 lines (+5/-14)1 file modifiedopenerp/osv/fields.py (+5/-14)
- Therp: Pending requested
-
Diff: 33 lines (+5/-14)1 file modifiedopenerp/osv/fields.py (+5/-14)
Changed in openobject-server: | |
status: | Incomplete → New |
Changed in openobject-server: | |
importance: | Low → Medium |
Changed in therp-backports: | |
status: | Confirmed → Fix Released |
Changed in therp-backports: | |
milestone: | 6.1-maintenance → 7.0-maintenance |
Changed in therp-backports: | |
milestone: | 7.0-maintenance → none |
Hello Stefan Rijnhart ,
I have checked this issue at my end.But I did not face any problem
as you mention in bug report.So would you please provide more information
regarding this issue.
I have attached a video for your more reference.
Correct me If I am wrong..
Thanks and waiting for reply!