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

[16.0]partner_invoicing_mode: Not grouping anymore invoice sby sale order partner or invoice partner. #1747

Open
javierjcf opened this issue Jun 25, 2024 · 0 comments
Labels

Comments

@javierjcf
Copy link

Module

Partner Invoicing Mode

Describe the bug

When this module is instaled, if you select 2 or more orders with differents customers, it creates only a invoice. Not grouped by partner either partner_invoice_id.

To Reproduce

Affected versions: 16

Steps to reproduce the behavior:

  1. Create 2 sale orders with diferent customers
  2. Select the two orders and generate invoiced
  3. Only one invoice is created

Expected behavior
Two diferent invoice created.

Additional context
It seems a lot of changes in this module in the last months. Very different to v 15 version.
I think the method def _get_invoice_grouping_keys(self) is the problem. It removes key partner_id and adds partner_invoice_id.
Odoo does not compare the grouping keys against the sale order, instead it does with the vals of the invoice, so no key partner_invoice_id in this dicctionary, it will allways be None, this is odoo code:
for _grouping_keys, invoices in groupby(invoice_vals_list, key=lambda x: [x.get(grouping_key) for grouping_key in invoice_grouping_keys]):

invcoice_vals_list will never contain partner_invoice_id. When odoo creates this dict, 'partner_id' key is alrready partner_invoice_id of sale_order, so i think removing partner_id key is an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant