summaryrefslogtreecommitdiff
path: root/addons/gamification
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2019-07-10 14:59:37 +0200
committerAdrian Torres <adt@odoo.com>2019-07-17 14:13:12 +0200
commit4b38cc6590abcb58a0ca102a06063eb3db7ac1f4 (patch)
treecfd11739fc6b4c0cb4b23b54cc6badad4bf5c55e /addons/gamification
parentf6fdde96bddfedf8764cd8a73089e44340d476ae (diff)
[REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly decorate methods with it, adds clutter and most people use it because they see that the rest of the code uses it. Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
Diffstat (limited to 'addons/gamification')
-rw-r--r--addons/gamification/models/badge.py1
-rw-r--r--addons/gamification/models/challenge.py6
-rw-r--r--addons/gamification/models/gamification_karma_rank.py1
-rw-r--r--addons/gamification/models/goal.py8
-rw-r--r--addons/gamification/models/res_users.py3
-rw-r--r--addons/gamification/wizard/grant_badge.py1
-rw-r--r--addons/gamification/wizard/update_goal.py1
7 files changed, 0 insertions, 21 deletions
diff --git a/addons/gamification/models/badge.py b/addons/gamification/models/badge.py
index b0483dbeae7..fc93ffb8041 100644
--- a/addons/gamification/models/badge.py
+++ b/addons/gamification/models/badge.py
@@ -143,7 +143,6 @@ class GamificationBadge(models.Model):
tools.image_resize_images(vals)
return super(GamificationBadge, self).create(values_list)
- @api.multi
def write(self, vals):
tools.image_resize_images(vals)
return super(GamificationBadge, self).write(vals)
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py
index 503ec655c5c..08194e0d7ec 100644
--- a/addons/gamification/models/challenge.py
+++ b/addons/gamification/models/challenge.py
@@ -167,7 +167,6 @@ class Challenge(models.Model):
return super(Challenge, self).create(vals)
- @api.multi
def write(self, vals):
if vals.get('user_domain'):
users = self._get_challenger_users(ustr(vals.get('user_domain')))
@@ -299,12 +298,10 @@ class Challenge(models.Model):
return True
- @api.multi
def action_start(self):
"""Start a challenge"""
return self.write({'state': 'inprogress'})
- @api.multi
def action_check(self):
"""Check a challenge
@@ -317,7 +314,6 @@ class Challenge(models.Model):
return self._update_all()
- @api.multi
def action_report_progress(self):
"""Manual report of a goal, does not influence automatic report frequency"""
for challenge in self:
@@ -602,7 +598,6 @@ class Challenge(models.Model):
return challenge.write({'last_report_date': fields.Date.today()})
##### Challenges #####
- @api.multi
def accept_challenge(self):
user = self.env.user
sudoed = self.sudo()
@@ -610,7 +605,6 @@ class Challenge(models.Model):
sudoed.write({'invited_user_ids': [(3, user.id)], 'user_ids': [(4, user.id)]})
return sudoed._generate_goals_from_challenge()
- @api.multi
def discard_challenge(self):
"""The user discard the suggested challenge"""
user = self.env.user
diff --git a/addons/gamification/models/gamification_karma_rank.py b/addons/gamification/models/gamification_karma_rank.py
index cd4ef6cc28a..cbbe7bf19d1 100644
--- a/addons/gamification/models/gamification_karma_rank.py
+++ b/addons/gamification/models/gamification_karma_rank.py
@@ -54,7 +54,6 @@ class KarmaRank(models.Model):
users._recompute_rank()
return res
- @api.multi
def write(self, vals):
tools.image_resize_images(vals)
res = super(KarmaRank, self).write(vals)
diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py
index abc6549a3dd..75db403647e 100644
--- a/addons/gamification/models/goal.py
+++ b/addons/gamification/models/goal.py
@@ -117,7 +117,6 @@ class GoalDefinition(models.Model):
definition._check_model_validity()
return definition
- @api.multi
def write(self, vals):
res = super(GoalDefinition, self).write(vals)
if vals.get('computation_mode', 'count') in ('count', 'sum') and (vals.get('domain') or vals.get('model_id')):
@@ -250,7 +249,6 @@ class Goal(models.Model):
return {self: result}
- @api.multi
def update_goal(self):
"""Update the goals to recomputes values and change of states
@@ -362,7 +360,6 @@ class Goal(models.Model):
self.env.cr.commit()
return True
- @api.multi
def action_start(self):
"""Mark a goal as started.
@@ -370,7 +367,6 @@ class Goal(models.Model):
self.write({'state': 'inprogress'})
return self.update_goal()
- @api.multi
def action_reach(self):
"""Mark a goal as reached.
@@ -378,14 +374,12 @@ class Goal(models.Model):
Progress at the next goal update until the end date."""
return self.write({'state': 'reached'})
- @api.multi
def action_fail(self):
"""Set the state of the goal to failed.
A failed goal will be ignored in future checks."""
return self.write({'state': 'failed'})
- @api.multi
def action_cancel(self):
"""Reset the completion after setting a goal as reached or failed.
@@ -398,7 +392,6 @@ class Goal(models.Model):
def create(self, vals):
return super(Goal, self.with_context(no_remind_goal=True)).create(vals)
- @api.multi
def write(self, vals):
"""Overwrite the write method to update the last_update field to today
@@ -417,7 +410,6 @@ class Goal(models.Model):
goal.challenge_id.sudo().report_progress(users=goal.user_id)
return result
- @api.multi
def get_action(self):
"""Get the ir.action related to update the goal
diff --git a/addons/gamification/models/res_users.py b/addons/gamification/models/res_users.py
index a0ca65ced45..51a29065156 100644
--- a/addons/gamification/models/res_users.py
+++ b/addons/gamification/models/res_users.py
@@ -25,7 +25,6 @@ class Users(models.Model):
for user in self:
user.karma_position = 0
- @api.multi
@api.depends('badge_ids')
def _get_user_badge_level(self):
""" Return total badge per level of users
@@ -55,14 +54,12 @@ class Users(models.Model):
res._recompute_rank()
return res
- @api.multi
def write(self, vals):
result = super(Users, self).write(vals)
if 'karma' in vals:
self._recompute_rank()
return result
- @api.multi
def add_karma(self, karma):
for user in self:
user.karma += karma
diff --git a/addons/gamification/wizard/grant_badge.py b/addons/gamification/wizard/grant_badge.py
index 49fc1aeebf1..84b764c5d53 100644
--- a/addons/gamification/wizard/grant_badge.py
+++ b/addons/gamification/wizard/grant_badge.py
@@ -13,7 +13,6 @@ class grant_badge_wizard(models.TransientModel):
badge_id = fields.Many2one("gamification.badge", string='Badge', required=True)
comment = fields.Text('Comment')
- @api.multi
def action_grant_badge(self):
"""Wizard action for sending a badge to a chosen user"""
diff --git a/addons/gamification/wizard/update_goal.py b/addons/gamification/wizard/update_goal.py
index dfa8995238e..e9664e05205 100644
--- a/addons/gamification/wizard/update_goal.py
+++ b/addons/gamification/wizard/update_goal.py
@@ -11,7 +11,6 @@ class goal_manual_wizard(models.TransientModel):
goal_id = fields.Many2one("gamification.goal", string='Goal', required=True)
current = fields.Float('Current')
- @api.multi
def action_update_current(self):
"""Wizard action for updating the current value"""
for wiz in self: