From 6908c475c5c63265db8a884451bd9c134868ef0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 18 Oct 2021 10:02:35 +0000 Subject: [PATCH] [FIX] mail, survey, website_slides: fix logger usage Make CI/Style happy even if not really related to this PR. Task-2621326 (Mail: add 'view' button in 'light notification template') Part-of: odoo/odoo#76418 --- addons/mail/models/mail_template.py | 6 +++++- addons/survey/wizard/survey_invite.py | 2 +- addons/website_slides/wizard/slide_channel_invite.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py index d679ac6c86b..710dbcb8e04 100644 --- a/addons/mail/models/mail_template.py +++ b/addons/mail/models/mail_template.py @@ -271,7 +271,11 @@ class MailTemplate(models.Model): try: template = self.env.ref(email_layout_xmlid, raise_if_not_found=True) except ValueError: - _logger.warning('QWeb template %s not found when sending template %s. Sending without layouting.' % (email_layout_xmlid, self.name)) + _logger.warning( + 'QWeb template %s not found when sending template %s. Sending without layout.', + email_layout_xmlid, + self.name + ) else: record = self.env[self.model].browse(res_id) model = self.env['ir.model']._get(record._name) diff --git a/addons/survey/wizard/survey_invite.py b/addons/survey/wizard/survey_invite.py index 8f61de8cd5a..ba48cb79c04 100644 --- a/addons/survey/wizard/survey_invite.py +++ b/addons/survey/wizard/survey_invite.py @@ -218,7 +218,7 @@ class SurveyInvite(models.TransientModel): try: template = self.env.ref(email_layout_xmlid, raise_if_not_found=True) except ValueError: - _logger.warning('QWeb template %s not found when sending survey mails. Sending without layouting.' % (email_layout_xmlid)) + _logger.warning('QWeb template %s not found when sending survey mails. Sending without layout', email_layout_xmlid) else: template_ctx = { 'message': self.env['mail.message'].sudo().new(dict(body=mail_values['body_html'], record_name=self.survey_id.title)), diff --git a/addons/website_slides/wizard/slide_channel_invite.py b/addons/website_slides/wizard/slide_channel_invite.py index c8dfbd145ea..6c66d0c5842 100644 --- a/addons/website_slides/wizard/slide_channel_invite.py +++ b/addons/website_slides/wizard/slide_channel_invite.py @@ -97,7 +97,7 @@ class SlideChannelInvite(models.TransientModel): try: template = self.env.ref(email_layout_xmlid, raise_if_not_found=True) except ValueError: - _logger.warning('QWeb template %s not found when sending slide channel mails. Sending without layouting.' % (email_layout_xmlid)) + _logger.warning('QWeb template %s not found when sending slide channel mails. Sending without layout.', email_layout_xmlid) else: # could be great to use _notify_prepare_template_context someday template_ctx = {