Export creates xml id based on wrong table name

Bug #1194893 reported by Stefan Rijnhart (Opener)
26
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.

Tags: maintenance

Related branches

Revision history for this message
Ray Carnes (rcarnes) wrote :

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.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

If by 'garbage id' you mean the instant ids of the form __export__.res_partner_69, this bug is right there where it generates them. Note that they linger around in the ir_model_data table and as such refer to possibly nonexisting records.

Revision history for this message
Ray Carnes (rcarnes) wrote :
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
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

Indeed this was an error, thanks for the report and the merge proposal. We have merged it into server 7.0

revno: 5248 [merge]
revision-id: <email address hidden>

Regards

Changed in openobject-server:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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