1 <?xml version="1.0" encoding="UTF-8"?>
5 <record id="challenge_list_view" model="ir.ui.view">
6 <field name="name">Challenges List</field>
7 <field name="model">gamification.challenge</field>
8 <field name="arch" type="xml">
9 <tree string="Goal definitions" colors="blue:state == 'draft';grey:state == 'done'">
11 <field name="period"/>
12 <field name="manager_id"/>
18 <record id="goals_from_challenge_act" model="ir.actions.act_window">
19 <field name="res_model">gamification.goal</field>
20 <field name="name">Related Goals</field>
21 <field name="view_mode">kanban,tree</field>
22 <field name="context">{'search_default_group_by_definition': True, 'search_default_inprogress': True, 'search_default_challenge_id': active_id, 'default_challenge_id': active_id}</field>
23 <field name="help" type="html">
25 There is no goals associated to this challenge matching your search.
26 Make sure that your challenge is active and assigned to at least one user.
31 <record id="challenge_form_view" model="ir.ui.view">
32 <field name="name">Challenge Form</field>
33 <field name="model">gamification.challenge</field>
34 <field name="arch" type="xml">
35 <form string="Goal definitions" version="7.0">
37 <button string="Refresh Challenge" type="object" name="action_check" states="inprogress"/>
38 <button string="Send Report" type="object" name="action_report_progress" states="inprogress,done" groups="base.group_no_one"/>
39 <field name="state" widget="statusbar" clickable="True"/>
43 <div class="oe_title">
44 <label for="name" class="oe_edit_only"/>
46 <field name="name" placeholder="e.g. Monthly Sales Objectives"/>
48 <label for="user_ids" class="oe_edit_only" string="Assign Challenge To"/>
50 <field name="user_ids" widget="many2many_tags" />
54 <!-- action buttons -->
55 <div class="oe_right oe_button_box">
57 name="%(goals_from_challenge_act)d"
58 class="oe_stat_button"
60 attrs="{'invisible': [('state','=','draft')]}">
61 <div>Related<br/>Goals</div>
66 <field name="period" attrs="{'readonly':[('state','!=','draft')]}"/>
67 <field name="visibility_mode" widget="radio" colspan="1" />
70 <field name="manager_id"/>
71 <field name="start_date" attrs="{'readonly':[('state','!=','draft')]}"/>
72 <field name="end_date" attrs="{'readonly':[('state','!=','draft')]}"/>
77 <field name="line_ids" nolabel="1" colspan="4">
78 <tree string="Line List" version="7.0" editable="bottom" >
79 <field name="sequence" widget="handle"/>
80 <field name="definition_id" on_change="on_change_definition_id(definition_id)" />
81 <field name="condition"/>
82 <field name="target_goal"/>
83 <field name="definition_full_suffix"/>
86 <field name="description" placeholder="Describe the challenge: what is does, who it targets, why it matters..."/>
88 <page string="Reward">
90 <field name="reward_id"/>
91 <field name="reward_first_id" />
92 <field name="reward_second_id" attrs="{'invisible': [('reward_first_id','=', False)]}" />
93 <field name="reward_third_id" attrs="{'invisible': ['|',('reward_first_id','=', False),('reward_second_id','=', False)]}" />
94 <field name="reward_failure" attrs="{'invisible': [('reward_first_id','=', False)]}" />
97 <p>Badges are granted when a challenge is finished. This is either at the end of a running period (eg: end of the month for a monthly challenge), at the end date of a challenge (if no periodicity is set) or when the challenge is manually closed.</p>
100 <page string="Advanced Options">
101 <group string="Subscriptions">
102 <field name="autojoin_group_id" />
103 <field name="invited_user_ids" widget="many2many_tags" />
105 <group string="Notification Messages">
106 <div class="oe_grey" colspan="4">
107 <p>Depending on the Display mode, reports will be individual or shared.</p>
109 <field name="report_message_frequency" />
110 <field name="report_template_id" attrs="{'invisible': [('report_message_frequency','=','never')]}" />
111 <field name="report_message_group_id" attrs="{'invisible': [('report_message_frequency','=','never')]}" />
113 <group string="Reminders for Manual Goals">
114 <label for="remind_update_delay" />
116 <field name="remind_update_delay" class="oe_inline"/> days
119 <group string="Category" groups="base.group_no_one">
120 <field name="category" widget="radio" />
126 <div class="oe_chatter">
127 <field name="message_follower_ids" widget="mail_followers"/>
128 <field name="message_ids" widget="mail_thread"/>
134 <record model="ir.ui.view" id="view_challenge_kanban">
135 <field name="name">Challenge Kanban</field>
136 <field name="model">gamification.challenge</field>
137 <field name="arch" type="xml">
138 <kanban string="Challenges" class="oe_background_grey" version="7.0">
139 <field name="line_ids"/>
140 <field name="user_ids"/>
142 <t t-name="kanban-box">
143 <div t-attf-class="oe_kanban_card oe_kanban_goal oe_kanban_global_click">
144 <div class="oe_dropdown_toggle oe_dropdown_kanban">
145 <span class="oe_e">í</span>
146 <ul class="oe_dropdown_menu">
147 <li><a type="edit">Configure Challenge</a></li>
150 <div class="oe_kanban_content">
152 <h4><field name="name"/></h4>
153 <div class="oe_kanban_project_list">
154 <a type="action" name="%(goals_from_challenge_act)d" style="margin-right: 10px">
155 <span t-if="record.line_ids.raw_value.length gt 1"><t t-esc="record.line_ids.raw_value.length"/> Goals</span>
156 <span t-if="record.line_ids.raw_value.length lt 2"><t t-esc="record.line_ids.raw_value.length"/> Goal</span>
159 <div class="oe_kanban_badge_avatars">
160 <t t-foreach="record.user_ids.raw_value.slice(0,11)" t-as="member">
161 <img t-att-src="kanban_image('res.users', 'image_small', member)" t-att-data-member_id="member"/>
172 <record id="challenge_list_action" model="ir.actions.act_window">
173 <field name="name">Challenges</field>
174 <field name="res_model">gamification.challenge</field>
175 <field name="view_mode">kanban,tree,form</field>
176 <field name="context">{'search_default_inprogress':True, 'default_inprogress':True}</field>
177 <field name="help" type="html">
178 <p class="oe_view_nocontent_create">
179 Click to create a challenge.
182 Assign a list of goals to chosen users to evaluate them.
183 The challenge can use a period (weekly, monthly...) for automatic creation of goals.
184 The goals are created for the specified users or member of the group.
188 <!-- Specify form view ID to avoid selecting view_challenge_wizard -->
189 <record id="challenge_list_action_view1" model="ir.actions.act_window.view">
190 <field eval="1" name="sequence"/>
191 <field name="view_mode">kanban</field>
192 <field name="act_window_id" ref="challenge_list_action"/>
193 <field name="view_id" ref="view_challenge_kanban"/>
195 <record id="challenge_list_action_view2" model="ir.actions.act_window.view">
196 <field eval="10" name="sequence"/>
197 <field name="view_mode">form</field>
198 <field name="act_window_id" ref="challenge_list_action"/>
199 <field name="view_id" ref="challenge_form_view"/>
203 <record id="challenge_line_list_view" model="ir.ui.view">
204 <field name="name">Challenge line list</field>
205 <field name="model">gamification.challenge.line</field>
206 <field name="arch" type="xml">
207 <tree string="Challenge Lines" >
208 <field name="definition_id"/>
209 <field name="target_goal"/>
215 <record id="challenge_search_view" model="ir.ui.view">
216 <field name="name">Challenge Search</field>
217 <field name="model">gamification.challenge</field>
218 <field name="arch" type="xml">
219 <search string="Search Challenges">
220 <filter name="inprogress" string="Running Challenges"
221 domain="[('state', '=', 'inprogress')]"/>
222 <filter name="hr_challenges" string="HR Challenges"
223 domain="[('category', '=', 'hr')]"/>
225 <group expand="0" string="Group By...">
226 <filter string="State" domain="[]" context="{'group_by':'state'}"/>
227 <filter string="Period" domain="[]" context="{'group_by':'period'}"/>
234 <record id="view_challenge_wizard" model="ir.ui.view">
235 <field name="name">Challenge Wizard</field>
236 <field name="model">gamification.challenge</field>
237 <field name="arch" type="xml">
238 <form string="Challenge" version="7.0">
239 <field name="reward_failure" invisible="1"/>
240 <div class="oe_title">
241 <h1><field name="name" nolabel="1" readonly="1"/></h1>
243 <field name="description" nolabel="1" readonly="1" />
245 <field name="start_date" readonly="1" />
246 <field name="end_date" readonly="1" />
247 <field name="user_ids" string="Participating" readonly="1" widget="many2many_tags" />
248 <field name="invited_user_ids" string="Invited" readonly="1" widget="many2many_tags" />
250 <group string="Goals">
251 <field name="line_ids" nolabel="1" readonly="1" colspan="4">
252 <tree string="Challenge Lines" version="7.0" editable="bottom" >
253 <field name="sequence" widget="handle"/>
254 <field name="definition_id"/>
255 <field name="condition"/>
256 <field name="target_goal"/>
257 <field name="definition_full_suffix"/>
261 <group string="Reward">
262 <div class="oe_grey" attrs="{'invisible': ['|',('reward_id','!=',False),('reward_first_id','!=',False)]}">
263 There is no reward upon completion of this challenge.
265 <group attrs="{'invisible': [('reward_id','=',False),('reward_first_id','=',False)]}">
266 <field name="reward_id" readonly="1" attrs="{'invisible': [('reward_first_id','=', False)]}" />
267 <field name="reward_first_id" readonly="1" attrs="{'invisible': [('reward_first_id','=', False)]}" />
268 <field name="reward_second_id" readonly="1" attrs="{'invisible': [('reward_second_id','=', False)]}" />
269 <field name="reward_third_id" readonly="1" attrs="{'invisible': [('reward_third_id','=', False)]}" />
271 <div class="oe_grey" attrs="{'invisible': [('reward_failure','=',False)]}">
272 Even if the challenge is failed, best challengers will be rewarded
277 <button string="Accept" type="object" name="accept_challenge" class="oe_highlight" />
278 <button string="Reject" type="object" name="discard_challenge"/> or
279 <button string="reply later" special="cancel" class="oe_link"/>
286 <record id="challenge_wizard" model="ir.actions.act_window">
287 <field name="name">Challenge Description</field>
288 <field name="res_model">gamification.challenge</field>
289 <field name="view_type">form</field>
290 <field name="view_id" ref="view_challenge_wizard"/>
291 <field name="target">new</field>