This question has been flagged
2 Replies
5489 Views

Is it possibe to override the import process for massaging some data. e.g. I want to import a CSV which has one of the columns (taxonomy/tags) as comma seperated names for products rather than ids. Can i somehow override the import process, read these and make corresponding entries. 

Avatar
Discard
Best Answer

Yes, you can create you own external_id so you can relink back to origninal data files. But if you want to import to mupliple tables/relations, the fields you import to are very specific in odoo. You should create test example and then export to see the exact field names from odoo. In the case of importing sales orders, it can get more complex, but will work. I have exported table using datebase_ids, not external, creating the tables, doing the relations and building a proper csv file that can match data from tables in odoo. This way you will be able to make sure your data is mapped correctly. I know many use .py script. If you know it well, then go for it. But I use my trusted datawasher built in Filemaker, yes you can laugh now, but I import 40,000 lines at a time that uses 12 tables in odoo, with a csv file. This works very well when mapping data from legacy databases.

Avatar
Discard
Author Best Answer

Thanks for the response. I was able to achieve this by creating a new model (inheriting the earlier model) that received the data in a format that i wanted (comma separated taxonomy names). I then overrid the create method of new model to not make any write calls but instead make a create call for the base model. This is after processing the data i.e. changing the comma seperated taxonomy names into taxonomy ids in the server. I then import data into the new importer model

Avatar
Discard