-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] account: allows ungrouped batch payment with different payment …
…terms Steps to reproduce: - Create two Bills with different payment terms with one having no "early_discount" such as '30% Now, Balance 60 Days' - Select the Bills and click on Register Payment (make sure the payment is not grouped) Issue: Server Error Cause: We try to Register Payment for all the Bills at once, but the "early_discount" is not defined for all the Bills. So, whenever there is a move with an early discount, the mode is always considered as "early_payment". Therefore, we call `_get_invoice_counterpart_amls_for_early_payment_discount` with an empty list since there is no early discount https://github.com/odoo/odoo/blob/0ffaaebfa5c25c4bf71fb0e02288767dbfac959d/addons/account/wizard/account_payment_register.py#L750-L755 https://github.com/odoo/odoo/blob/0ffaaebfa5c25c4bf71fb0e02288767dbfac959d/addons/account/wizard/account_payment_register.py#L760 Causing the "local variable 'aml' referenced before assignment" error. Solution: We only iterate through moves belonging to the batch. This way, we avoid setting the mode to "early_payment" and entering the confition. opw-3378445 closes odoo#131543 Signed-off-by: Laurent Smet (las) <las@odoo.com>
- Loading branch information
Showing
2 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters