shopinvader / pattern-import-export

Module that allows to configure a pattern file for import/export
GNU Affero General Public License v3.0
11 stars 16 forks source link

Creating a single record using a sub-pattern on a O2M field breaks imports #93

Closed kevinkhao closed 2 years ago

kevinkhao commented 2 years ago

Scenario: You have two models, Parent, and Child

Parent has a O2M field called Children

You want to express that some Parent "Alice" has a Child named "Bob"

You import an excel file with something like: children_ids|1|name#key Bob

Expected behaviour: If Bob doesn't exist, a Child is created and linked to Alice (this works) If Bob exists, nothing should happen ==> This crashes

Crash occurs only when two conditions are met:

Please check https://github.com/shopinvader/pattern-import-export/pull/92 for an example

kevinkhao commented 2 years ago

here https://github.com/odoo/odoo/blob/ce47d09c05e4bcc91ee4de68db3a7a471bcb4df8/odoo/addons/base/models/ir_fields.py#L486 we get an id with an int, split() expects str

sebastienbeau commented 2 years ago

PR https://github.com/shopinvader/pattern-import-export/pull/92 have been merged