odoo/odoo#261581

Created by fw-bot
Merged at 1f9c876ad2b683bdf119207129e770075e075bf9

Statuses:

label
odoo-dev:saas-19.3-18.0-opw-5969972-group_payment_includes_all_installments-waelg-520827-fw
head
f113575563c8807478a7837ea35cff3175d40780
merged
1 month ago by Waleed Elgamal (waelg)
odoo/odoo
18.0 #257871
saas-18.2 #260781
saas-18.3 #260933
saas-18.4 #261269
19.0 #261304
saas-19.1 #261346
saas-19.2 #261371
saas-19.3 #261581
master #261608

[FIX] account: include next installment(s) only in group payments

Steps to reproduce:
1- Install Accounting and make sure "Batch Payments" is enabled in settings
2- Go to [Accounting -> Vendors -> Bills]
3- Create two bills for the same vendor, ensuring one of them has multiple installments (i.e payment term with 3 installments)
4- Confirm the bills
5- In list view, select both bills and another bill from a different vendor and click on Pay
6- Select "Group Payments" and confirm the payment

Description of issue:
The batch payment of the first vendor has the full amount for both bills

Expected behavior:
The payment should consider the full amount of the first bill and the first installment only of the second bill

opw-5969972

Forward-Port-Of: #261371
Forward-Port-Of: #257871