Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
130 Tampilan

Hi all,

I am trying to import a list of Person contacts and link them to particular Company records, but match on a Company record value, not the Company record name itself. The reason I want to do this is because we have many Company records with the same "Name" as they are the same company, but a different office or location with a different shipping address. If I imported these Person contacts and tried to match them to their companies based on the "Name" field, it wouldn't be possible, as there are duplicate names.

What I am currently trying is to have the records with a custom x-studio field of Integer type with the Company records' unique value e.g., "201" for "Company1".

Then I am trying to import the list of Person contacts, which have the person's email, phone, etc, but then also the "CompanyID" which would have e.g. "201" and should be matched to "Company1".
However, when I am importing the list of Person contacts and I select the Many2One "Related Company" field, even with "Allow matching with subfields" enabled it doesn't work properly and I just get "No matching records found for the following name in field Related Company: 201 at row 1"


Here is an example of the Company records I've imported:

Name

Address

RecordID

Company Name1

123 Street

201

Company Name1

321 Road

202

Company 2

555 Street Ln

203

Here is an example of the Person records I am trying to import:

Name

Department

Companies.RecordID

John Joe

Finance

201

Jane Doe

Engineering

202

Larry Jack


203

Thanks for the help! (I am using Odoo 19 Online)

Avatar
Buang
Penulis Jawaban Terbai

I ended up just exporting the imported Company records, then replacing the .csv Person records Companies.RecordID field with the Company records ExternalID, and then importing the Person records. This properly linked the Person records to the company records using the unique ExternalID. Not the most elegant solution, but using Excel Power Query made swapping the values pretty easy. 

Avatar
Buang