summaryrefslogtreecommitdiff
path: root/addons/gamification
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/gamification
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/gamification')
-rw-r--r--addons/gamification/models/challenge.py6
-rw-r--r--addons/gamification/models/goal.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py
index c424a8c4b28..72fcf48ebad 100644
--- a/addons/gamification/models/challenge.py
+++ b/addons/gamification/models/challenge.py
@@ -596,7 +596,7 @@ class Challenge(models.Model):
def accept_challenge(self):
user = self.env.user
sudoed = self.sudo()
- sudoed.message_post(body=_("%s has joined the challenge") % user.name)
+ sudoed.message_post(body=_("%s has joined the challenge", user.name))
sudoed.write({'invited_user_ids': [(3, user.id)], 'user_ids': [(4, user.id)]})
return sudoed._generate_goals_from_challenge()
@@ -604,7 +604,7 @@ class Challenge(models.Model):
"""The user discard the suggested challenge"""
user = self.env.user
sudoed = self.sudo()
- sudoed.message_post(body=_("%s has refused the challenge") % user.name)
+ sudoed.message_post(body=_("%s has refused the challenge", user.name))
return sudoed.write({'invited_user_ids': (3, user.id)})
def _check_challenge_reward(self, force=False):
@@ -652,7 +652,7 @@ class Challenge(models.Model):
if challenge_ended:
# open chatter message
- message_body = _("The challenge %s is finished.") % challenge.name
+ message_body = _("The challenge %s is finished.", challenge.name)
if rewarded_users:
user_names = rewarded_users.name_get()
diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py
index 9a14a1438c3..2236a5baa45 100644
--- a/addons/gamification/models/goal.py
+++ b/addons/gamification/models/goal.py
@@ -430,7 +430,7 @@ class Goal(models.Model):
if self.computation_mode == 'manually':
# open a wizard window to update the value manually
action = {
- 'name': _("Update %s") % self.definition_id.name,
+ 'name': _("Update %s", self.definition_id.name),
'id': self.id,
'type': 'ir.actions.act_window',
'views': [[False, 'form']],