Skip to content

[16.0] partner_invoicing_mode: Using _get_invoice_grouping_keys() in read_group() leads to incompatibility with other modules #2073

@AungKoKoLin1997

Description

@AungKoKoLin1997

Module

partner_invoicing_mode

Affected versions: 16.0
Didn't check in other versions.

Describe the bug

Using _get_invoice_grouping_keys() in read_group() of sale.order leads to incompatibility with other modules if they want to add new keys from the account.move model.

IIUC, this method is for defining grouping keys for the invoice values (i.e., keys from _prepare_invoice()), not necessarily fields from the sale.order model itself.

However, in partner_invoicing_mode, these keys are passed directly to read_group(), which requires them to be actual fields on sale.order.

saleorder_groups = self.read_group(
domain,
["partner_invoice_id", "sale_ids:array_agg(id)"],
groupby=self._get_invoice_grouping_keys(),
lazy=False,
)

You can see the incompatibility in this PR:
#2071

@qrtl

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions