From aff954bd63458ada9c9ccca696e638e3f2b82de4 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 27 Feb 2018 10:35:00 +0100 Subject: [PATCH] [FIX] account: link bank to partner Changes to a bank account should not be happening without approval and not in an in-transparent way. In some cases, a third party can pay an invoice for another account opw-1817138 --- addons/account/models/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 9bbfbbc7c70..43745287c33 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -338,7 +338,7 @@ class AccountBankStatement(models.Model): def link_bank_to_partner(self): for statement in self: for st_line in statement.line_ids: - if st_line.bank_account_id and st_line.partner_id and st_line.bank_account_id.partner_id != st_line.partner_id: + if st_line.bank_account_id and st_line.partner_id and not st_line.bank_account_id.partner_id: st_line.bank_account_id.partner_id = st_line.partner_id