From c39be93667da42a73a6ea8146fa4ee00c3fee4e8 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 14 Mar 2013 15:24:39 +0100 Subject: [PATCH] [IMP] small changes bzr revid: mat@openerp.com-20130314142439-04espxwt7049xzz5 --- addons/gamification/badge.py | 2 ++ addons/gamification/badge_view.xml | 3 ++- addons/gamification/security/gamification_security.xml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/gamification/badge.py b/addons/gamification/badge.py index 2ba9f5f6c1b..2240e4486fa 100644 --- a/addons/gamification/badge.py +++ b/addons/gamification/badge.py @@ -60,6 +60,7 @@ class gamification_badge(osv.Model): for obj in self.browse(cr, uid, ids, context=context): result[obj.id] = len(self.pool.get('gamification.badge.user').search( cr, uid, [('badge_id', '=', obj.id)], context=context)) + result[obj.id] = len(obj.owner_ids) return result def _get_unique_global_count(self, cr, uid, ids, name, args, context=None): @@ -154,6 +155,7 @@ class gamification_badge(osv.Model): 'stat_count_distinct': fields.function(_get_unique_global_count, string='Unique Count', help="The number of time this badge has been received by individual users."), + # TODO store result for working domain stat_this_month >= rule_max_number 'stat_this_month': fields.function(_get_month_count, string='Monthly Count', help="The number of time this badge has been received this month."), diff --git a/addons/gamification/badge_view.xml b/addons/gamification/badge_view.xml index f5471beaa58..6e7bfa83058 100644 --- a/addons/gamification/badge_view.xml +++ b/addons/gamification/badge_view.xml @@ -70,7 +70,7 @@ ('rule_auth', '=', 'nobody'), '&', ('rule_max', '=', True), - ('stat_this_month', '>', 'rule_max_number') + ('stat_this_month', '>=', 'rule_max_number') ]}" />