From 25ee880164c616bdd3ff2dc5503f987b271f8242 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Wed, 27 Apr 2022 09:58:11 +0000 Subject: [PATCH] [FIX] account: Fix reconcile not posted entries in register payment wizard Fix a lost condition during a refactoring introduced by: https://github.com/odoo/odoo/pull/82025 When dealing with payment transactions, a payment could be still in draft even after the call the 'action_post'. closes odoo/odoo#90235 X-original-commit: 14cdb80774b638a39f430bc49c0c4d5a01925d90 Signed-off-by: Olivier Colson Signed-off-by: Laurent Smet --- addons/account/wizard/account_payment_register.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/wizard/account_payment_register.py b/addons/account/wizard/account_payment_register.py index ecaedbea5f3..46ecda5d326 100644 --- a/addons/account/wizard/account_payment_register.py +++ b/addons/account/wizard/account_payment_register.py @@ -675,7 +675,11 @@ class AccountPaymentRegister(models.TransientModel): to which a payment will be created (see '_get_batches'). :param edit_mode: Is the wizard in edition mode. """ - domain = [('account_internal_type', 'in', ('receivable', 'payable')), ('reconciled', '=', False)] + domain = [ + ('parent_state', '=', 'posted'), + ('account_internal_type', 'in', ('receivable', 'payable')), + ('reconciled', '=', False), + ] for vals in to_process: payment_lines = vals['payment'].line_ids.filtered_domain(domain) lines = vals['to_reconcile']