Merge lp:~therp-nl/openupgrade-server/6.0-lp1025797-dangling_references into lp:openupgrade-server/6.0
Proposed by
Stefan Rijnhart (Opener)
Status: | Merged |
---|---|
Merged at revision: | 3493 |
Proposed branch: | lp:~therp-nl/openupgrade-server/6.0-lp1025797-dangling_references |
Merge into: | lp:openupgrade-server/6.0 |
Diff against target: |
23 lines (+13/-0) 1 file modified
bin/osv/orm.py (+13/-0) |
To merge this branch: | bzr merge lp:~therp-nl/openupgrade-server/6.0-lp1025797-dangling_references |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Don Kirkby (community) | Disapprove | ||
Holger Brunn (Therp) | Approve | ||
Review via email: mp+115518@code.launchpad.net |
Description of the change
As reported in the associated issue, OpenERP 5 leaves dangling references to removed resources in ir_model_data. This branch checks for them at model initialization time and removes them.
To post a comment you must log in.
This proposal would solve the error, as well as bug 1025819, along with any other modules where deleted records cause problems.
However, I don't like the fact that records magically reappear during the migration, perhaps months after some administrator deleted them. That's why I recreated them as inactive records in my merge proposal.
How about a third option? Create a working table and copy all the dangling ir_model_data records there, then delete them. At the end of the migration, go through the working table and deactivate all the records that got recreated. That way, it's a general solution that doesn't require custom scripting for each module, you don't have to make up bogus values for the recreated records, but the deleted records still aren't visible.
If you agree in principle, I'll make a merge proposal for you to review. If you still prefer the current proposal, I can work around it by recreating the records before I start the migration.