summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorSuganthi Karunanithi <ksuganthi@sodexis.com>2019-02-26 14:46:48 +0000
committerNicolas Lempereur <nle@odoo.com>2019-03-06 18:00:53 +0000
commiteb62cd2c2b8eba2fceee4f0491a7f9a045de73d5 (patch)
treede3af03ffc9d7eb615798e40ebb2d7bc6de2dd29 /addons
parenta8465d523516b97c613296568a326cb141d5fd23 (diff)
[FIX] gamification: badge auth for badge no error
To avoid exception: TypeError: Mixing apples and oranges: gamification.badge() - gamification.badge.user(1,) when rule_auth of a badge is set to `having`. opw-1945440 closes #31436 closes #31595 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/gamification/models/badge.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/gamification/models/badge.py b/addons/gamification/models/badge.py
index 58553981ab7..842bd88f673 100644
--- a/addons/gamification/models/badge.py
+++ b/addons/gamification/models/badge.py
@@ -236,7 +236,7 @@ class GamificationBadge(models.Model):
elif self.rule_auth == 'users' and self.env.user not in self.rule_auth_user_ids:
return self.USER_NOT_VIP
elif self.rule_auth == 'having':
- all_user_badges = self.env['gamification.badge.user'].search([('user_id', '=', self.env.uid)])
+ all_user_badges = self.env['gamification.badge.user'].search([('user_id', '=', self.env.uid)]).mapped('badge_id')
if self.rule_auth_badge_ids - all_user_badges:
return self.BADGE_REQUIRED