diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 377a85b191c..3f7124fca7a 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -3063,7 +3063,7 @@ class AccountMove(models.Model): 'res_model': 'account.invoice.send', 'view_mode': 'form', 'context': { - 'default_email_layout_xmlid': 'mail.mail_notification_paynow', + 'default_email_layout_xmlid': 'mail.mail_notification_layout_with_responsible_signature', 'default_template_id': self.env.ref(self._get_mail_template()).id, 'mark_invoice_as_sent': True, 'active_model': 'account.move', @@ -3099,7 +3099,7 @@ class AccountMove(models.Model): default_template_id=template and template.id or False, default_composition_mode='comment', mark_invoice_as_sent=True, - default_email_layout_xmlid="mail.mail_notification_paynow", + default_email_layout_xmlid="mail.mail_notification_layout_with_responsible_signature", model_description=self.with_context(lang=lang).type_name, force_email=True, ) @@ -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..06007c72bb8 100644 --- a/addons/mail/data/mail_templates_chatter.xml +++ b/addons/mail/data/mail_templates_chatter.xml @@ -3,15 +3,10 @@