ExpandReferences
Specifies whether multi-valued Many2Many and One2Many fields are expanded into separate rows.
Data Type
bool
Default Value
false
Remarks
By default, Many2Many and One2Many fields are collapsed into comma-separated values within a single row. For example, if a calendar event is associated with partners 13 and 57, the partner_ids field appears as '13,57'.
When this property is set to true, the provider expands these multi-valued fields across multiple rows—one for each unique combination. This behavior makes it easier to join tables on relationship fields but results in duplicated row data.
To support this expansion, the provider generates a synthetic primary key called id:multi, since the original id field is no longer unique when rows are duplicated. This key is assigned client-side and should not be used in filters, as it depends on the full result set returned by Odoo.
This property does not affect how records are inserted. Even when expansion is enabled, multi-valued fields must still be inserted as comma-separated values.
Performance Considerations
Expanding multi-valued references can significantly increase the number of rows returned, especially when multiple Many2Many or One2Many fields are present. While this can improve usability in joins, it may slow down query performance and increase memory usage. Consider enabling this option only when working with relationships that require relational joins or flattening.