[IMP] adapt badge view to new structure of rules

bzr revid: mat@openerp.com-20130312083043-748w2k70rho8xka2
This commit is contained in:
Martin Trigaux
2013-03-12 09:30:43 +01:00
parent 666e1142bd
commit 67aa009dfc
2 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -160,10 +160,11 @@ class gamification_badge(osv.Model):
help="The number of time the current user has received this badge this month."),
}
_default = {
_defaults = {
'stat_count': 0,
'stat_count_distinct': 0,
'stat_this_month': 0,
'rule_auth': 'everyone',
'rule_automatic': 'manual',
}
+7 -3
View File
@@ -74,14 +74,18 @@
</h1>
</div>
<field name="description" />
<group string="Rules">
<field name="rule_auth"/>
<group string="User Rules">
<field name="rule_auth" string="Allowed to Grant" />
<field name="rule_auth_user_ids" attrs="{'invisible': [('rule_auth','!=','users')]}" widget="many2many_tags" />
<field name="rule_auth_badge_ids" attrs="{'invisible': [('rule_auth','!=','having')]}" widget="many2many_tags" />
<field name="compute_code" attrs="{'invisible': [('rule_auth','!=','computed')]}"/>
<field name="rule_max"/>
<field name="rule_max_number" attrs="{'invisible': [('rule_max','=',False)]}"/>
</group>
<group string="Automatic Rules">
<field name="rule_automatic"/>
<field name="compute_code" attrs="{'invisible': [('rule_automatic','!=','python')]}"/>
<field name="goal_type_ids" attrs="{'invisible': [('rule_automatic','!=','goals')]}" widget="many2many_tags"/>
</group>
</sheet>
</form>
</field>