Skip to content
Snippets Groups Projects
Commit f20b3adc authored by Luc De Meyer's avatar Luc De Meyer
Browse files

[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#43367

X-original-commit: 3d74e739
Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
parent 6842d85a
No related branches found
No related tags found
No related merge requests found
......@@ -776,7 +776,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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment