Export creates xml id based on wrong table name
Bug #1194893 reported by
Stefan Rijnhart (Opener)
This bug affects 5 people
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP Publisher's Warranty Team | |||
OpenERP Community Backports (Server) | Status tracked in 7.0 | |||||
7.0 |
Fix Released
|
Medium
|
Stefan Rijnhart (Opener) |
Bug Description
When exporting many2one fields, _get_xml_id crafts an xml id using the table name of the exported model, not of the many2one model.
For instance, when exporting a partner's receivable account, the ir_model_data entry of an account with database id 659 looks like this:
name | res_id | model
-------
res_partner_659_1 | 659 | res.partner
Because the model from this table is ignored at import time, the xml id can actually be reused. But meanwhile, the integrity of the table is broken because there is no partner with id 659. And it looks bad in the export file.
Related branches
lp:~therp-nl/openobject-server/7.0-lp1194893-export_xmlid_wrong_table_name
- Martin Trigaux (OpenERP) (community): Approve
-
Diff: 44 lines (+6/-5)2 files modifiedopenerp/osv/orm.py (+3/-3)
openerp/tests/addons/test_impex/tests/test_export.py (+3/-2)
lp:~therp-nl/ocb-server/7.0-lp1194893-export_xmlid_wrong_table_name
- Holger Brunn (Therp): Approve (code review)
- Nicolas Bessi - Camptocamp (community): Approve (no test code review only)
-
Diff: 28 lines (+3/-3)1 file modifiedopenerp/osv/orm.py (+3/-3)
lp:~therp-nl/ocb-server/7.0-lp1194893-fix_tests
- Christophe CHAUVET: Approve (code review, no test)
- Holger Brunn (Therp): Approve (code review)
- Pedro Manuel Baeza: Approve (code review, no test)
-
Diff: 15 lines (+3/-2)1 file modifiedopenerp/tests/addons/test_impex/tests/test_export.py (+3/-2)
Changed in openobject-server: | |
assignee: | nobody → OpenERP's Framework R&D (openerp-dev-framework) |
importance: | Undecided → Medium |
status: | New → Confirmed |
summary: |
- [7.0] Export creates xml id based on wrong table name + Export creates xml id based on wrong table name |
Changed in openobject-server: | |
assignee: | OpenERP's Framework R&D (openerp-dev-framework) → OpenERP Publisher's Warranty Team (openerp-opw) |
tags: | added: maintenance |
To post a comment you must log in.
Does this happen only when there is no XML for the account? I have always assumed that if there are no XML id's for a model record, OpenERP will generate 'garbage' id's unless you export directly from the model form/list view.