[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
This commit is contained in:
Christophe Matthieu
2016-03-23 11:22:51 +01:00
parent 1936367fd2
commit 2abc2ceee0
+2 -2
View File
@@ -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",