[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 <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
This commit is contained in:
Laurent Smet
2022-05-02 18:48:44 +02:00
parent a14efdd0a6
commit 25ee880164
@@ -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']