diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 9f2b28a7f20..537fb9ba22e 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1124,7 +1124,10 @@ class AccountMoveLine(models.Model): self._update_check() #when we set the expected payment date, log a note on the invoice_id related (if any) if vals.get('expected_pay_date') and self.invoice_id: - msg = _('New expected payment date: ') + fields.Date.to_string(vals['expected_pay_date']) + '.\n' + vals.get('internal_note', '') + str_expected_pay_date = vals['expected_pay_date'] + if isinstance(str_expected_pay_date, date): + str_expected_pay_date = fields.Date.to_string(str_expected_pay_date) + msg = _('New expected payment date: ') + str_expected_pay_date + '.\n' + vals.get('internal_note', '') self.invoice_id.message_post(body=msg) #TODO: check it is an internal note (not a regular email)! #when making a reconciliation on an existing liquidity journal item, mark the payment as reconciled for record in self: