From e080a84edfa8438d76fdf5aeb5d8b7f1cc7b2aee Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Sat, 4 Nov 2023 16:58:36 +0100 Subject: [PATCH] [FIX] payment order: fix compute_partner_bank_id Fix _compute_partner_bank_id on account.move.line. The bank account number of then invoice was not selected when a supplier has multiple bank account numbers and there is no payment mode set on the vendor bill. This PR corrects this issue. --- account_payment_order/models/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_payment_order/models/account_move_line.py b/account_payment_order/models/account_move_line.py index d7b813fd9..244000a98 100644 --- a/account_payment_order/models/account_move_line.py +++ b/account_payment_order/models/account_move_line.py @@ -31,7 +31,7 @@ class AccountMoveLine(models.Model): if ( ml.move_id.move_type in ("in_invoice", "in_refund") and not ml.reconciled - and ml.payment_mode_id.payment_order_ok + and (ml.payment_mode_id.payment_order_ok or not ml.payment_mode_id) and ml.account_id.internal_type in ("receivable", "payable") and not any( p_state in ("draft", "open", "generated")