summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2013-03-14 15:24:39 +0100
committerMartin Trigaux <mat@openerp.com>2013-03-14 15:24:39 +0100
commitc39be93667da42a73a6ea8146fa4ee00c3fee4e8 (patch)
treefba2ee28bcedec0dc59c6b13057f43daef5e486a /addons
parent9f05370cfc6b89d68a46f7d014aa237f12b2766a (diff)
[IMP] small changes
bzr revid: mat@openerp.com-20130314142439-04espxwt7049xzz5
Diffstat (limited to 'addons')
-rw-r--r--addons/gamification/badge.py2
-rw-r--r--addons/gamification/badge_view.xml3
-rw-r--r--addons/gamification/security/gamification_security.xml2
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'),
'&amp;',
('rule_max', '=', True),
- ('stat_this_month', '&gt;', 'rule_max_number')
+ ('stat_this_month', '&gt;=', 'rule_max_number')
]}" />
<button string="Check Badge" type="object" name="check_automatic" groups="base.group_no_one" />
</div>
@@ -103,6 +103,7 @@
<field name="stat_this_month"/>
<field name="stat_my"/>
<field name="stat_my_this_month"/>
+ <field name="owner_ids"/>
</group>
</sheet>
</form>
diff --git a/addons/gamification/security/gamification_security.xml b/addons/gamification/security/gamification_security.xml
index 85e8742c60f..1862961f3e3 100644
--- a/addons/gamification/security/gamification_security.xml
+++ b/addons/gamification/security/gamification_security.xml
@@ -18,7 +18,7 @@
</record>
</data>
- <data noupdate="0">
+ <data noupdate="1">
<record id="goal_user_visibility" model="ir.rule">
<field name="name">User can only see his/her goals</field>
<field name="model_id" ref="model_gamification_goal"/>