Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
When doing csv imports, how to force a column mapping to an id of an OpenERP element?
I know it can be done manually using the menus by opening the mapping menu and selecting "OpenERP element / BD Id" instead of "OpenERP element" (which tends to map itself to the name of that entity and not the id).
How can this be automated?
Although you have solved your problem, allow me to provide a different solution. You can specify XML ID as a replacement of that field. The column into which this value need to be imported is field/id (e.g. parent_id/id). To obtain the XML ID, first perform export first for that particular model and make sure that you exported the id field.
If you want the ids to map existing objects you can generate one file ir.model.data.csv and associate the xml_ids that you are going to import to existing objects (model, res_id).
For example if your database has already the stock locations (110, 111, 112) and you want to reference them :
After importing the new xml_ids you can import your csv with those xml_id references.
About This Community
This platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 9/2/14, 7:03 AM|
|Seen: 3335 times|
|Last updated: 5/11/18, 10:33 AM|