2013-03-11 09:39:30 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<openerp >
<data >
2013-03-18 12:46:20 +00:00
<!-- Badge views -->
2013-03-11 09:39:30 +00:00
<record id= "badge_list_action" model= "ir.actions.act_window" >
<field name= "name" > Badges</field>
<field name= "res_model" > gamification.badge</field>
2013-03-15 15:02:30 +00:00
<field name= "view_mode" > kanban,tree,form</field>
2013-03-11 09:39:30 +00:00
<field name= "help" type= "html" >
<p class= "oe_view_nocontent_create" >
Click to create a badge.
</p>
<p >
A badge is a symbolic token granted to a user as a sign of reward.
It can be deserved automatically when some conditions are met or manually by users.
2013-04-10 11:50:23 +00:00
Some badges are harder than others to get with specific conditions.
2013-03-11 09:39:30 +00:00
</p>
</field>
</record>
2013-03-11 16:57:16 +00:00
<record id= "view_badge_wizard_grant" model= "ir.ui.view" >
<field name= "name" > Grant Badge User Form</field>
<field name= "model" > gamification.badge.user.wizard</field>
<field name= "arch" type= "xml" >
<form string= "Grant Badge To" version= "7.0" >
2013-04-10 09:14:37 +00:00
Who would you like to reward?
2013-03-11 16:57:16 +00:00
<group >
2013-04-11 13:24:38 +00:00
<field name= "user_id" nolabel= "1" />
2013-03-11 16:57:16 +00:00
<field name= "badge_id" invisible= "1" />
2013-04-12 14:09:58 +00:00
<field name= "comment" nolabel= "1" placeholder= "Describe what they did and why it matters (will be public)" class= "oe_no_padding" />
2013-03-11 16:57:16 +00:00
</group>
<footer >
<button string= "Grant Badge" type= "object" name= "action_grant_badge" class= "oe_highlight" /> or
<button string= "Cancel" special= "cancel" class= "oe_link" />
</footer>
</form>
</field>
</record>
<act_window domain= "[]" id= "action_grant_wizard"
name="Grant Badge"
target="new"
res_model="gamification.badge.user.wizard"
context="{'default_badge_id': active_id, 'badge_id': active_id}"
2013-03-29 13:07:14 +00:00
view_type="form" view_mode="form"
view_id="gamification.view_badge_wizard_grant" />
2013-03-11 16:57:16 +00:00
2013-03-11 09:39:30 +00:00
<record id= "badge_list_view" model= "ir.ui.view" >
<field name= "name" > Badge List</field>
<field name= "model" > gamification.badge</field>
<field name= "arch" type= "xml" >
<tree string= "Badge List" >
<field name= "name" />
<field name= "stat_count" />
2013-03-14 12:01:57 +00:00
<field name= "stat_this_month" />
2013-03-11 11:04:23 +00:00
<field name= "stat_my" />
2013-03-19 10:00:35 +00:00
<field name= "rule_auth" />
2013-03-11 09:39:30 +00:00
</tree>
</field>
</record>
<record id= "badge_form_view" model= "ir.ui.view" >
<field name= "name" > Badge Form</field>
<field name= "model" > gamification.badge</field>
<field name= "arch" type= "xml" >
<form string= "Badge" version= "7.0" >
2013-03-18 09:21:30 +00:00
<header >
2013-04-12 13:36:06 +00:00
<button string= "Grant this Badge" type= "action" name= "%(action_grant_wizard)d" class= "oe_highlight" attrs= "{'invisible': [('remaining_sending','=',0)]}" />
2013-03-18 09:21:30 +00:00
<button string= "Check Badge" type= "object" name= "check_automatic" groups= "base.group_no_one" />
</header>
2013-03-11 09:39:30 +00:00
<sheet >
2013-04-12 13:36:06 +00:00
<div class= "oe_right oe_button_box" >
</div>
2013-03-11 09:39:30 +00:00
<field name= "image" widget= 'image' class= "oe_left oe_avatar" />
<div class= "oe_title" >
<label for= "name" class= "oe_edit_only" />
<h1 >
<field name= "name" />
</h1>
</div>
2013-03-12 16:15:56 +00:00
<group >
2013-04-11 15:11:32 +00:00
<field name= "description" nolabel= "1" placeholder= "Badge Description" />
2013-03-12 16:15:56 +00:00
</group>
2013-04-16 10:27:24 +00:00
<group string= "Granting" >
2013-04-12 09:43:13 +00:00
<field name= "rule_auth" widget= "radio" />
2013-03-11 16:57:16 +00:00
<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" />
2013-03-18 13:04:09 +00:00
<field name= "rule_max" attrs= "{'invisible': [('rule_auth','=','nobody')]}" />
2013-04-11 09:21:03 +00:00
<field name= "rule_max_number" attrs= "{'invisible': ['|',('rule_max','=',False),('rule_auth','=','nobody')]}" />
2013-04-12 08:54:52 +00:00
<label for= "stat_my_monthly_sending" />
<div >
<field name= "stat_my_monthly_sending" attrs= "{'invisible': [('rule_auth','=','nobody')]}" />
<div attrs= "{'invisible': [('remaining_sending','=',-1)]}" class= "oe_grey" >
2013-04-16 10:27:24 +00:00
You can still grant <field name= "remaining_sending" class= "oe_inline" /> badges this month
2013-04-12 08:54:52 +00:00
</div>
<div attrs= "{'invisible': [('remaining_sending','!=',-1)]}" class= "oe_grey" >
No monthly sending limit
</div>
</div>
2013-03-11 09:39:30 +00:00
</group>
2013-04-16 10:27:24 +00:00
<group string= "Rewards for challenges" >
<field name= "plan_ids" widget= "many2many_kanban" nolabel= "1" />
</group>
2013-04-18 08:24:02 +00:00
<group string= "Statistics" >
2013-04-11 15:11:32 +00:00
<group >
<field name= "stat_count" />
<field name= "stat_this_month" />
<field name= "stat_count_distinct" />
</group>
<group >
<field name= "stat_my" />
<field name= "stat_my_this_month" />
</group>
2013-03-14 12:01:57 +00:00
</group>
2013-03-11 09:39:30 +00:00
</sheet>
</form>
</field>
</record>
2013-03-13 15:11:30 +00:00
<record id= "badge_kanban_view" model= "ir.ui.view" >
<field name= "name" > Badge Kanban View</field>
<field name= "model" > gamification.badge</field>
<field name= "arch" type= "xml" >
<kanban version= "7.0" class= "oe_background_grey" >
<field name= "name" />
<field name= "description" />
<field name= "image" />
<field name= "stat_my" />
2013-03-18 09:21:30 +00:00
<field name= "stat_count" />
2013-04-12 08:54:52 +00:00
<field name= "stat_this_month" />
2013-04-02 08:40:27 +00:00
<field name= "unique_owner_ids" />
2013-04-12 14:09:58 +00:00
<field name= "stat_my_monthly_sending" />
2013-04-12 08:54:52 +00:00
<field name= "remaining_sending" />
<field name= "rule_max_number" />
2013-03-13 15:11:30 +00:00
<templates >
<t t-name= "kanban-box" >
2013-03-29 14:34:07 +00:00
<div t-attf-class= "#{record.stat_my.raw_value ? 'oe_kanban_color_5' : 'oe_kanban_color_white'} oe_kanban_card oe_kanban_global_click oe_kanban_badge" >
2013-03-13 15:11:30 +00:00
<div class= "oe_kanban_content" >
<div class= "oe_kanban_left" >
2013-04-12 09:43:13 +00:00
<a type= "open" > <img t-att-src= "kanban_image('gamification.badge', 'image', record.image.raw_value)" t-att-title= "record.name.value" width= "110" height= "110" /> </a>
2013-03-13 15:11:30 +00:00
</div>
2013-04-12 08:54:52 +00:00
<div >
2013-04-12 13:36:06 +00:00
<h4 > <field name= "name" /> </h4>
2013-04-12 08:54:52 +00:00
<t t-if= "record.description.value" >
<em > <field name= "description" /> </em>
2013-03-29 16:31:37 +00:00
</t>
2013-04-12 08:54:52 +00:00
<p >
Total: <t t-esc= "record.stat_count.raw_value" /> (<t t-esc= "record.stat_this_month.raw_value" /> this month)
</p>
<t t-if= "record.remaining_sending.value != 0" >
<button type= "action" name= "%(action_grant_wizard)d" class= "oe_highlight" > Grant</button>
2013-04-12 09:43:13 +00:00
<span class= "oe_grey" >
2013-04-12 08:54:52 +00:00
<t t-if= "record.remaining_sending.value != -1" >
2013-04-12 14:09:58 +00:00
<t t-esc= "record.stat_my_monthly_sending.value" /> /<t t-esc= "record.rule_max_number.value" />
2013-04-12 08:54:52 +00:00
</t>
<t t-if= "record.remaining_sending.value == -1" >
2013-04-12 14:09:58 +00:00
<t t-esc= "record.stat_my_monthly_sending.value" /> /∞
2013-04-12 08:54:52 +00:00
</t>
2013-04-12 09:43:13 +00:00
</span>
2013-04-12 08:54:52 +00:00
</t>
<t t-if= "record.remaining_sending.value == 0" >
2013-04-16 12:45:58 +00:00
<div class= "oe_grey" > Can not grant</div>
2013-04-12 08:54:52 +00:00
</t>
2013-04-12 09:43:13 +00:00
</div>
<div class= "oe_kanban_badge_avatars" >
2013-04-12 13:36:06 +00:00
<a type= "object" name= "get_granted_employees" >
<t t-foreach= "record.unique_owner_ids.raw_value.slice(0,11)" t-as= "owner" >
<img t-att-src= "kanban_image('res.users', 'image_small', owner)" t-att-data-member_id= "owner" />
</t>
</a>
2013-04-12 09:43:13 +00:00
</div>
2013-03-13 15:11:30 +00:00
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
2013-03-18 12:46:20 +00:00
<!-- Badge user viewss -->
<record id= "badge_user_kanban_view" model= "ir.ui.view" >
<field name= "name" > Badge User Kanban View</field>
<field name= "model" > gamification.badge.user</field>
<field name= "arch" type= "xml" >
<kanban version= "7.0" class= "oe_background_grey" >
<field name= "badge_name" />
<field name= "badge_id" />
<field name= "user_id" />
<field name= "comment" />
<field name= "create_date" />
<templates >
<t t-name= "kanban-box" >
2013-04-12 08:54:52 +00:00
<div class= "oe_kanban_card oe_kanban_global_click oe_kanban_badge oe_kanban_color_white" >
2013-03-18 12:46:20 +00:00
<div class= "oe_kanban_content" >
<div class= "oe_kanban_left" >
<a type= "open" > <img t-att-src= "kanban_image('gamification.badge', 'image', record.badge_id.raw_value)" t-att-title= "record.badge_name.value" width= "24" height= "24" /> </a>
</div>
<h4 >
<a type= "open" > <t t-esc= "record.badge_name.raw_value" /> </a>
</h4>
<t t-if= "record.comment.raw_value" >
2013-03-18 14:14:57 +00:00
<p > <em > <field name= "comment" /> </em> </p>
2013-03-18 12:46:20 +00:00
</t>
2013-04-11 10:15:43 +00:00
<p > Granted by <a type= "open" > <field name= "create_uid" /> </a> the <t t-esc= "record.create_date.raw_value.toString(Date.CultureInfo.formatPatterns.shortDate)" /> </p>
2013-03-18 12:46:20 +00:00
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
2013-03-11 09:39:30 +00:00
</data>
</openerp>