Skip to content

Conversation

AungKoKoLin1997
Copy link
Contributor

This module adds the sale_partner_id field to invoices and displays it in the invoice report.

It assumes that each invoice is linked to a single sale partner. If multiple sales orders with the same invoice partner but different sale partners are grouped, the invoices will be split accordingly.

@qrtl QT5614

@AungKoKoLin1997
Copy link
Contributor Author

AungKoKoLin1997 commented Aug 7, 2025

My module is currently not compatible with partner_invoicing_mode because it assumes that _get_invoice_grouping_keys() returns only fields that exist 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,
)

IIUC, this method defines grouping based on invoice values (i.e., keys returned from _prepare_invoice()), not necessarily fields on 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, leading to the incompatibility.

Should I mark my module as a rebel module to avoid incompatibility issues?

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-add-account_move_sale_partner branch from abb2962 to 298115c Compare September 11, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants