Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Generated xml id belongs to a module that is not installed

By
martin mueller
on 9/18/13, 3:59 PM 1,752 views

When exporting fields via csv, they get an auto-generated xml id looking like __export__.res_partner_5. This can be used to reimport the fields with new values via csv.

But when I try to use the same xml id in an xml file:

 <record model="res.partner" id="__export__.res_partner_5">
   <field name="is_company" eval="False"/>  
 </record>

the import fails, because OpenERP validates the xml id by checking if the module "__export__" (the part left of the dot), is an installed module (ir_module_module).

  File "C:\Program Files (x86)\OpenERP\Server\server\.\openerp\tools\convert.py", line 256, in _test_xml_id
 AssertionError: The ID "__export__.res_partner_5" refers to an uninstalled module

Is this by design?

1

Andreas Brueckl

--Andreas Brueckl--
5056
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 9/25/13, 10:46 AM

If entires have been created manually, OpenERP prefixes the XML ID with __export__. if they are exported. Now it depends what you want to accomplish with the import:

  • If you want to create new lines, then you can simply remove the ID field.
  • If you want to update existing entries, I think this is not possible

But when I reimport the file in csv format from within a module (with a "'data': ['res.partner.csv']," section), then it works. It seems that convert_csv_import does not the same things as convert_xml_import in convert.py

martin mueller
on 9/25/13, 3:34 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 9/18/13, 3:59 PM
Seen: 1752 times
Last updated: 3/16/15, 8:10 AM