Related Issue
This is related to #185 which documents the bug. This issue is for the enhancement to add validation.
Proposal
Add validation logic to detect when the same field appears in both --groupby and --deferred-fields arguments.
Suggested Implementation
In the argument parsing or pre-flight check:
if groupby_field and groupby_field in deferred_fields:
raise ValueError(
f"Field '{groupby_field}' cannot be used in both --groupby and --deferred-fields. "
f"Remove --groupby or remove the field from --deferred-fields."
)
Alternatives
- Auto-fix: Automatically remove the field from groupby when it's deferred (with a warning)
- Documentation: At minimum, document this incompatibility
Context
This was discovered during an Odoo 12 → 18 migration where res.partner parent/child relationships were silently broken due to this flag combination in the import script.
Related Issue
This is related to #185 which documents the bug. This issue is for the enhancement to add validation.
Proposal
Add validation logic to detect when the same field appears in both
--groupbyand--deferred-fieldsarguments.Suggested Implementation
In the argument parsing or pre-flight check:
Alternatives
Context
This was discovered during an Odoo 12 → 18 migration where
res.partnerparent/child relationships were silently broken due to this flag combination in the import script.