Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2615 Widoki

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 ​|

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sty 23
7070
1
mar 20
4457
2
gru 19
6769
1
lip 18
3927
5
kwi 18
8353