From 62d0bdf5db9fc1437be1cc6cd23611ba4daacec2 Mon Sep 17 00:00:00 2001 From: "Nicolas (vin)" Date: Fri, 21 Aug 2020 12:30:41 +0000 Subject: [PATCH] [FIX] account: fix invoice register payment wizard The register payment wizard for invoices is fetching a default account for the partner in a compute, without verifying the company. This can cause the wizard to load an bank account from another company and block the user to finish the payment. This commit will make sure the account loaded is from the current company. Task id #2308032 closes odoo/odoo#57072 Signed-off-by: Laurent Smet --- addons/account/wizard/account_payment_register.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/wizard/account_payment_register.py b/addons/account/wizard/account_payment_register.py index 459d8097f66..5a7ac194c5e 100644 --- a/addons/account/wizard/account_payment_register.py +++ b/addons/account/wizard/account_payment_register.py @@ -261,7 +261,7 @@ class AccountPaymentRegister(models.TransientModel): def _compute_partner_bank_id(self): ''' The default partner_bank_id will be the first available on the partner. ''' for wizard in self: - available_partner_bank_accounts = wizard.partner_id.bank_ids + available_partner_bank_accounts = wizard.partner_id.bank_ids.filtered_domain([('company_id', '=', wizard.company_id.id)]) if available_partner_bank_accounts: wizard.partner_bank_id = available_partner_bank_accounts[0]._origin else: