This question has been flagged
1 Reply
836 Views

Hello. We want to migrate data from our application with an old database to Odoo. And we started, for example, from the Vendors table. In our application, the individual vendor or the company vendor is placed on the same table Vendors. The individual vendor has the First Name, Last Name, and Company Name. The company has only the Company Name.

For example, we have the next records:

ID ​| First Name ​| Last Name ​| Company Name
1 ​| John ​| Smith ​| Google
2 ​| ​| ​| Google

When we import these 2 records to Odoo we see the two records in the Vendors list. When we edit the first one, we see that the company name = is "Google", but the "+ Create company" button is active. And when we press it Odoo creates another record of a company with the name "Google". So, in this case, the record of "John Smith" related to the "Google" company record which was created by Odoo, not with the "Google" record that was imported. But we want to create a relationship with both of our imported records.

How we can do it? 
In the documentation, we find the info about External ID, but it seems that we don't fully understand it, because the next structure of the Excel to import doesn't create a relationship:

ID ​| First Name ​| Last Name ​| Company Name ​| External ID
1 ​| John ​| Smith ​| Google ​| 2
2 ​| ​| ​| Google ​|

Avatar
Discard
Best Answer

Im on V16. The name of the field is "Related company" and it is a many2one field related to the model that you are trying to import. That means the you need to import the vendor companies first, then import the vendor individuals while specifying a company that is already in the system as the related company.

So change that field name to "related company" instead of "company name". Remove all individuals from that list, import and then import the individuals.

Avatar
Discard