Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX]partner_invoicing_mode: Invalid partner_invoice_id key to group sales. Fix #1747 #1749

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

javierjcf
Copy link

@javierjcf javierjcf commented Jun 27, 2024

I'm not sure about this, but I already explained it in issue #1747.
It seems there is new code added that wasn't in v15. In my opinion, it's a mistake to use the key partner_invoice_id for grouping. Odoo doesn't use it to compare against the sales order but against the values of the dictionary that will generate the invoice.

https://github.com/odoo/odoo/blob/56946ff1a99a1f02f2ec708161a754e22c25fe80/addons/sale/models/sale_order.py#L1155

That is, it is always evaluated as None. In this dictionary, Odoo assigns the field partner_id the value of partner_invoice_id from the order:

https://github.com/odoo/odoo/blob/56946ff1a99a1f02f2ec708161a754e22c25fe80/addons/sale/models/sale_order.py#L1003

Therefore, if we want to group by invoice address, we should use the key partner_id, since this key is in the invoice value dictionary and already contains the value of the order's partner_invoice_id.

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.

1 participant