summaryrefslogtreecommitdiff
path: root/addons/gamification/models
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2016-03-23 11:17:42 +0100
committerChristophe Matthieu <chm@odoo.com>2016-03-23 11:22:51 +0100
commit2abc2ceee005cf03ac0dff240898466b1c439738 (patch)
treea9cf7539d2089e0a86ff61f8c6519d9b5fb50fcc /addons/gamification/models
parent1936367fd2253d8c362b37f92674b434f22e8565 (diff)
[IMP] gamification: split multi function field to avoid massive prefetching of user records
Issue: website_forum takes 15 to 30 seconds to load the user page
Diffstat (limited to 'addons/gamification/models')
-rw-r--r--addons/gamification/models/badge.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/gamification/models/badge.py b/addons/gamification/models/badge.py
index 69d36def904..5fffc29f488 100644
--- a/addons/gamification/models/badge.py
+++ b/addons/gamification/models/badge.py
@@ -182,12 +182,12 @@ class gamification_badge(osv.Model):
'stat_count': fields.function(_get_owners_info, string='Total',
type="integer",
- multi='unique_users',
+ multi='stat_users',
help="The number of time this badge has been received."),
'stat_count_distinct': fields.function(_get_owners_info,
type="integer",
string='Number of users',
- multi='unique_users',
+ multi='stat_users',
help="The number of time this badge has been received by unique users."),
'stat_this_month': fields.function(_get_badge_user_stats,
type="integer",