You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the field state_id is related to country_id, so if my dictionary returns "AV", there is an"AV" state in Spain, and another "AV" state in Italy, so it throws this error: "Found multiple matches for field 'State' (2 matches)"
I would need something like this: state = fields.Many2one('country',related=city.country) related=city.country is the important point.
What is the right way to map a related field like state_id?
Thank you
The text was updated successfully, but these errors were encountered:
Hello,
When you are importing many2one, you should always use the external_id of your record to avoid shush issue. so state_id/id should be the key of your mapping.
If you use state_id, the server will check with the name_search and indeed if the name search return more than one result you'll get this error.
Hi,
When I import the field state_id in res.partner, I do it this way (like any other field):
But the field state_id is related to country_id, so if my dictionary returns "AV", there is an"AV" state in Spain, and another "AV" state in Italy, so it throws this error: "Found multiple matches for field 'State' (2 matches)"
I would need something like this:
state = fields.Many2one('country',related=city.country)
related=city.country is the important point.
What is the right way to map a related field like state_id?
Thank you
The text was updated successfully, but these errors were encountered: