summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_thread.py
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-06-04 12:39:11 +0200
committerMartin Trigaux <mat@odoo.com>2020-06-18 13:03:34 +0200
commitba244cef01132347df4d2d9553ea3105ba13a938 (patch)
tree20cdb55afb6b9f700bfe2844a90ca8de0050c941 /addons/mail/models/mail_thread.py
parent3c3b88f6768e31417263b3828a874ca204e29514 (diff)
[IMP] *: replace to new _() syntax
Using a few regex like \((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\) ($1, $3)) Old syntax is still compatible but starts the migration to the new syntax that catches error.
Diffstat (limited to 'addons/mail/models/mail_thread.py')
-rw-r--r--addons/mail/models/mail_thread.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py
index ee16931f25e..3f8818bc386 100644
--- a/addons/mail/models/mail_thread.py
+++ b/addons/mail/models/mail_thread.py
@@ -544,7 +544,7 @@ class MailThread(models.AbstractModel):
"""
self.ensure_one()
doc_name = self.env['ir.model']._get(self._name).name
- return _('%s created') % doc_name
+ return _('%s created', doc_name)
def _track_subtype(self, init_values):
""" Give the subtypes triggered by the changes on the record according
@@ -671,7 +671,7 @@ class MailThread(models.AbstractModel):
def _routing_warn(self, error_message, message_id, route, raise_exception=True):
""" Tools method used in _routing_check_route: whether to log a warning or raise an error """
- short_message = _("Mailbox unavailable - %s") % error_message
+ short_message = _("Mailbox unavailable - %s", error_message)
full_message = ('Routing mail with Message-Id %s: route %s: %s' %
(message_id, route, error_message))
_logger.info(full_message)
@@ -791,7 +791,7 @@ class MailThread(models.AbstractModel):
self._routing_warn(_('target model unspecified'), message_id, route, raise_exception)
return ()
elif model not in self.env:
- self._routing_warn(_('unknown target model %s') % model, message_id, route, raise_exception)
+ self._routing_warn(_('unknown target model %s', model), message_id, route, raise_exception)
return ()
record_set = self.env[model].browse(thread_id) if thread_id else self.env[model]
@@ -801,12 +801,12 @@ class MailThread(models.AbstractModel):
self._routing_warn(_('reply to missing document (%s,%s), fall back on document creation') % (model, thread_id), message_id, route, False)
thread_id = None
elif not hasattr(record_set, 'message_update'):
- self._routing_warn(_('reply to model %s that does not accept document update, fall back on document creation') % model, message_id, route, False)
+ self._routing_warn(_('reply to model %s that does not accept document update, fall back on document creation', model), message_id, route, False)
thread_id = None
# New Document: check model accepts the mailgateway
if not thread_id and model and not hasattr(record_set, 'message_new'):
- self._routing_warn(_('model %s does not accept document creation') % model, message_id, route, raise_exception)
+ self._routing_warn(_('model %s does not accept document creation', model), message_id, route, raise_exception)
return ()
# Update message author. We do it now because we need it for aliases (contact settings)
@@ -2595,7 +2595,7 @@ class MailThread(models.AbstractModel):
access_link = self._notify_get_action_link('view')
if model_name:
- view_title = _('View %s') % model_name
+ view_title = _('View %s', model_name)
else:
view_title = _('View')
@@ -2859,7 +2859,7 @@ class MailThread(models.AbstractModel):
assignation_msg = view._render(values, engine='ir.qweb', minimal_qcontext=True)
assignation_msg = self.env['mail.render.mixin']._replace_local_links(assignation_msg)
record.message_notify(
- subject=_('You have been assigned to %s') % record.display_name,
+ subject=_('You have been assigned to %s', record.display_name),
body=assignation_msg,
partner_ids=partner_ids,
record_name=record.display_name,