From f08204c69c684a6614bbbebc834178355b4aad03 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Tue, 24 Dec 2019 11:48:49 +0000 Subject: [PATCH] [FIX] account: don't overwrite statement_line_id when reconciling transfer account Description of the issue: Transfer between Bank1 (550001) and Bank 2 (550002) of the same company via the intercompany bank account (580000) : Bank 1: minus 1000 EUR, we create the following accounting entry via the reconcile widget account 550001 credit 1000 account 580000 debit 1000 Bank 2 : Plus 1000 EUR When we select the counterparty 580000 entry of the Bank 1 statement via the reconcile widget than the statement_line_id of the entry from Bank 1 statement is replaced by the one of the Bank 2 statement. Hence this account.move.line is linked to the wrong statement line. closes odoo/odoo#43371 X-original-commit: 3d74e7397e15311f1e9189589a435d9683376317 Signed-off-by: oco-odoo --- 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 a1bacfc7c2b..416f6b18493 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -852,7 +852,7 @@ class AccountBankStatementLine(models.Model): # Create counterpart move lines and reconcile them for aml_dict in counterpart_aml_dicts: - if aml_dict['move_line'].payment_id: + if aml_dict['move_line'].payment_id and not aml_dict['move_line'].statement_line_id: aml_dict['move_line'].write({'statement_line_id': self.id}) if aml_dict['move_line'].partner_id.id: aml_dict['partner_id'] = aml_dict['move_line'].partner_id.id