From 5ca58418ec32b8de8528266427b3eacc2a91277e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Tue, 17 May 2022 12:59:51 +0200 Subject: [PATCH] [FIX] account_reconciliation_widget: set statement name to move ref --- .../models/account_bank_statement.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/account_reconciliation_widget/models/account_bank_statement.py b/account_reconciliation_widget/models/account_bank_statement.py index e27203dc..631cdca0 100644 --- a/account_reconciliation_widget/models/account_bank_statement.py +++ b/account_reconciliation_widget/models/account_bank_statement.py @@ -200,6 +200,7 @@ class AccountBankStatementLine(models.Model): aml_obj.with_context(check_move_validity=False).create(liquidity_aml_dict) self.sequence = self.statement_id.line_ids.ids.index(self.id) + 1 + self.move_id.ref = self._get_move_ref(self.statement_id.name) counterpart_moves = counterpart_moves | self.move_id # Complete dicts to create both counterpart move lines and write-offs @@ -252,6 +253,12 @@ class AccountBankStatementLine(models.Model): return counterpart_moves + def _get_move_ref(self, move_ref): + ref = move_ref or "" + if self.ref: + ref = move_ref + " - " + self.ref if move_ref else self.ref + return ref + def _prepare_move_line_for_currency(self, aml_dict, date): self.ensure_one() company_currency = self.journal_id.company_id.currency_id