60c758a717d6a9e4a357fb40446d05318d0fc35e
[odoo/odoo.git] / addons / hr_gamification / views / gamification.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <openerp>
3     <data>
4
5         <record id="hr_badge_form_view" model="ir.ui.view">
6             <field name="name">Badge Form</field>
7             <field name="model">gamification.badge</field>
8             <field name="inherit_id" ref="gamification.badge_form_view"/>
9             <field name="arch" type="xml">
10                 <xpath expr="//div[@class='oe_right oe_button_box']" position="inside">
11                     <button string="Granted Employees" type="object" name="get_granted_employees" attrs="{'invisible': [('stat_count','=',0)]}" />
12                 </xpath>
13             </field>
14         </record>
15
16         <!-- HR Employee -->
17
18         <record id="hr_hr_employee_view_form" model="ir.ui.view">
19             <field name="name">hr.hr.employee.view.form</field>
20             <field name="model">hr.employee</field>
21             <field name="inherit_id" ref="hr.view_employee_form"/>
22             <field name="arch" type="xml">
23
24                 <xpath expr="//page[@string='Public Information']" position="before">
25                     <page string="Received Badges" attrs="{'invisible': [('user_id', '=', False)]}">
26                         <field name="has_badges" invisible="1"/>
27                         <button string="Grant a Badge" type="action" name="%(action_reward_wizard)d"/> to reward this employee for a good action
28                         <div class="oe_view_nocontent" attrs="{'invisible': [('has_badges', '=', True)]}">
29                             <p class="oe_view_nocontent_create">
30                                 Click to grant this employee his first badge
31                             </p><p class="oe_grey">
32                                 Badges are rewards of good work. Give them to people you believe deserve it.
33                             </p>
34                         </div>
35                         <field name="badge_ids" widget="many2many_kanban" />
36                     </page>
37                 </xpath>
38                 <xpath expr="//page[@string='Public Information']" position="after">
39                     <page string="Goals">
40                         <field name="goal_ids" widget="many2many_kanban" />
41                     </page>
42                 </xpath>
43
44             </field>
45         </record>
46
47
48         <record id="goals_menu_groupby_action2" model="ir.actions.act_window">
49             <field name="res_model">gamification.goal</field>
50             <field name="view_type">form</field>
51             <field name="name">Goals History</field>
52             <field name="view_mode">tree,kanban</field>
53             <field name="context">{'search_default_group_by_user': True, 'search_default_group_by_definition': True}</field>
54             <field name="domain">[('challenge_id.category', '=', 'hr')]</field>
55             <field name="help" type="html">
56                 <p class="oe_view_nocontent_create">
57                     Click to create a goal. 
58                 </p>
59                 <p>
60                     A goal is defined by a user and a goal type.
61                     Goals can be created automatically by using challenges.
62                 </p>
63             </field>
64         </record>
65
66
67         <record id="challenge_list_action2" model="ir.actions.act_window">
68             <field name="name">Challenges</field>
69             <field name="res_model">gamification.challenge</field>
70             <field name="view_mode">kanban,tree,form</field>
71             <field name="domain">[('category', '=', 'hr')]</field>
72             <field name="context">{'search_default_inprogress':True, 'default_inprogress':True}</field>
73             <field name="help" type="html">
74                 <p class="oe_view_nocontent_create">
75                     Click to create a challenge. 
76                 </p>
77                 <p>
78                     Assign a list of goals to chosen users to evaluate them.
79                     The challenge can use a period (weekly, monthly...) for automatic creation of goals.
80                     The goals are created for the specified users or member of the group.
81                 </p>
82             </field>
83         </record>
84         <record id="challenge_list_action2_view1" model="ir.actions.act_window.view">
85             <field eval="1" name="sequence"/>
86             <field name="view_mode">kanban</field>
87             <field name="act_window_id" ref="challenge_list_action2"/>
88             <field name="view_id" ref="gamification.view_challenge_kanban"/>
89         </record>
90         <record id="challenge_list_action2_view2" model="ir.actions.act_window.view">
91             <field eval="10" name="sequence"/>
92             <field name="view_mode">form</field>
93             <field name="act_window_id" ref="challenge_list_action2"/>
94             <field name="view_id" ref="gamification.challenge_form_view"/>
95         </record>
96
97         <menuitem id="menu_hr_gamification" parent="hr.menu_hr_root" name="Engagement" sequence="40"/>
98
99         <menuitem id="gamification_badge_menu_hr" parent="menu_hr_gamification" action="gamification.badge_list_action" />
100         <menuitem id="gamification_challenge_menu_hr" parent="menu_hr_gamification" action="challenge_list_action2" groups="base.group_hr_user"/>
101         <menuitem id="gamification_goal_menu_hr" parent="menu_hr_gamification" action="goals_menu_groupby_action2" groups="base.group_hr_user"/>
102
103     </data>
104 </openerp>