Skip to content

Bug: Using same field in both --groupby and --deferred-fields causes undefined behavior #185

@bosd

Description

@bosd

Description

When the same field is specified in both --groupby and --deferred-fields, the import produces undefined behavior where Pass 2 parent_id resolution fails silently.

Steps to Reproduce

odoo-data-flow import \
  --file data/res_partner.csv \
  --model res.partner \
  --deferred-fields parent_id/id \
  --groupby parent_id/id

Expected Behavior

Either:

  1. Raise an error/warning when conflicting flags are detected
  2. Auto-remove the field from groupby when it's in deferred-fields

Actual Behavior

  • Pass 1 ignores parent_id/id (correctly deferred)
  • But --groupby parent_id/id tries to batch records by a field that isn't being imported
  • Pass 2 fails to resolve parent_id relationships

Impact

Parent/child relationships (like res.partner contacts under companies) are not established, causing data integrity issues.

Workaround

Remove --groupby when using --deferred-fields for the same field.

Environment

  • odoo-data-flow version: latest
  • Odoo version: 18.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions