diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index b272de830a7..15fa128cb30 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -830,6 +830,9 @@ class AccountBankStatementLine(models.Model): } st_line.process_reconciliation(new_aml_dicts=[vals]) + def _get_communication(self, payment_method_id): + return self.name or '' + def process_reconciliation(self, counterpart_aml_dicts=None, payment_aml_rec=None, new_aml_dicts=None): """ Match statement lines with existing payments (eg. checks) and/or payables/receivables (eg. invoices and refunds) and/or new move lines (eg. write-offs). If any new journal item needs to be created (via new_aml_dicts or counterpart_aml_dicts), a new journal entry will be created and will contain those @@ -928,7 +931,7 @@ class AccountBankStatementLine(models.Model): 'state': 'reconciled', 'currency_id': currency.id, 'amount': abs(total), - 'communication': self.name or '', + 'communication': self._get_communication(payment_methods[0] if payment_methods else False), 'name': self.statement_id.name, })