diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 377a85b191c..0f87d565aae 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -3584,13 +3584,15 @@ class AccountMove(models.Model): message, msg_vals, model_description=model_description, force_email_company=force_email_company, force_email_lang=force_email_lang ) + subtitles = [render_context['record'].name] if self.invoice_date_due: - render_context['subtitle'] = _('%(amount)s due\N{NO-BREAK SPACE}%(date)s', + subtitles.append(_('%(amount)s due\N{NO-BREAK SPACE}%(date)s', amount=format_amount(self.env, self.amount_total, self.currency_id, lang_code=render_context.get('lang')), date=format_date(self.env, self.invoice_date_due, date_format='short', lang_code=render_context.get('lang')) - ) + )) else: - render_context['subtitle'] = format_amount(self.env, self.amount_total, self.currency_id, lang_code=render_context.get('lang')) + subtitles.append(format_amount(self.env, self.amount_total, self.currency_id, lang_code=render_context.get('lang'))) + render_context['subtitles'] = subtitles return render_context # ------------------------------------------------------------------------- diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 2586bceff1e..db4613877ab 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -16,6 +16,7 @@ from odoo.exceptions import UserError, AccessError from odoo.osv import expression from odoo.tools.translate import _ from odoo.tools import date_utils, email_re, email_split, is_html_empty, groupby +from odoo.tools.misc import get_lang from . import crm_stage @@ -1792,6 +1793,17 @@ class Lead(models.Model): return self.env.ref('crm.mt_lead_lost') return super(Lead, self)._track_subtype(init_values) + def _notify_by_email_prepare_rendering_context(self, message, msg_vals=False, model_description=False, + force_email_company=False, force_email_lang=False): + render_context = super()._notify_by_email_prepare_rendering_context( + message, msg_vals, model_description=model_description, + force_email_company=force_email_company, force_email_lang=force_email_lang + ) + if self.date_deadline: + render_context['subtitles'].append( + _('Deadline: %s', self.date_deadline.strftime(get_lang(self.env).date_format))) + return render_context + def _notify_get_recipients_groups(self, msg_vals=None): """ Handle salesman recipients that can convert leads into opportunities and set opportunities as won / lost. """ diff --git a/addons/mail/data/mail_templates_chatter.xml b/addons/mail/data/mail_templates_chatter.xml index 3d86bdfe9ec..a230a48b603 100644 --- a/addons/mail/data/mail_templates_chatter.xml +++ b/addons/mail/data/mail_templates_chatter.xml @@ -3,15 +3,12 @@ - -