This question has been flagged

Hello,

I have researched a lot in the forum and I can not find a way to be able to import a csv file with columns whose value is not the name, id and external id of a related field.

Example:
Model 1:

_inherit = "res.partner"

Field1 = fields.Char (string = "Example")


Model 2:

  _name = 'mymodel'

     Field1 = fields.Char (string = "This is an example field")
     Partner = fields.Many2one ('res.partner', string = "Supplier")

I can not find a way to import a column into the csv file and relate it to the "field 1" field in the partner model.

I appreciate any help you can give me with the case.

Thank you very much!

Avatar
Discard
Best Answer

Hi Gabriel,

What does it show while trying to import the CSV file ?

Make sure that the relation field , ie, the field partner in the CSV of  'mymodel' hold the id of the res.partner.

You can refer this doc it will give you some more information .

Thank You



Avatar
Discard
Author Best Answer

The problem is that I do not have the partner id in the csv file (it is a report that generates another system). I only have the field data "field1" and I want to relate this to the related field for the partner in the csv to import. I do not have the id, external id or the name.

Many thanks in advance for the answer Niyas!

Avatar
Discard

Hi,

Then just add a new column into the csv file reprsenting the field , and give the corresponding values into it.