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_domain" class="oe_edit_only" string="Assign Challenge To"/>
50 <field name="user_domain" widget="char_domain" options="{'model': 'res.users'}" />
51 <field name="user_ids" groups="base.group_no_one" widget="many2many_tags" />
55 <!-- action buttons -->
56 <div class="oe_right oe_button_box">
58 name="%(goals_from_challenge_act)d"
59 class="oe_stat_button"
61 attrs="{'invisible': [('state','=','draft')]}">
62 <div>Related<br/>Goals</div>
67 <field name="period" attrs="{'readonly':[('state','!=','draft')]}"/>
68 <field name="visibility_mode" widget="radio" colspan="1" />
71 <field name="manager_id"/>
72 <field name="start_date" attrs="{'readonly':[('state','!=','draft')]}"/>
73 <field name="end_date" attrs="{'readonly':[('state','!=','draft')]}"/>
78 <field name="line_ids" nolabel="1" colspan="4">
79 <tree string="Line List" version="7.0" editable="bottom" >
80 <field name="sequence" widget="handle"/>
81 <field name="definition_id" on_change="on_change_definition_id(definition_id)" />
82 <field name="condition"/>
83 <field name="target_goal"/>
84 <field name="definition_full_suffix"/>
87 <field name="description" placeholder="Describe the challenge: what is does, who it targets, why it matters..."/>
89 <page string="Reward">
91 <field name="reward_id" attrs="{'required': [('reward_realtime','=', True)]}" />
92 <field name="reward_first_id" />
93 <field name="reward_second_id" attrs="{'invisible': [('reward_first_id','=', False)]}" />
94 <field name="reward_third_id" attrs="{'invisible': ['|',('reward_first_id','=', False),('reward_second_id','=', False)]}" />
95 <field name="reward_failure" attrs="{'invisible': [('reward_first_id','=', False)]}" />
96 <field name="reward_realtime" />
99 <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>
102 <page string="Advanced Options">
103 <group string="Subscriptions">
104 <field name="invited_user_ids" widget="many2many_tags" />
106 <group string="Notification Messages">
107 <div class="oe_grey" colspan="4">
108 <p>Depending on the Display mode, reports will be individual or shared.</p>
110 <field name="report_message_frequency" />
111 <field name="report_template_id" attrs="{'invisible': [('report_message_frequency','=','never')]}" />
112 <field name="report_message_group_id" attrs="{'invisible': [('report_message_frequency','=','never')]}" />
114 <group string="Reminders for Manual Goals">
115 <label for="remind_update_delay" />
117 <field name="remind_update_delay" class="oe_inline"/> days
120 <group string="Category" groups="base.group_no_one">
121 <field name="category" widget="radio" />
127 <div class="oe_chatter">
128 <field name="message_follower_ids" widget="mail_followers"/>
129 <field name="message_ids" widget="mail_thread"/>
135 <record model="ir.ui.view" id="view_challenge_kanban">
136 <field name="name">Challenge Kanban</field>
137 <field name="model">gamification.challenge</field>
138 <field name="arch" type="xml">
139 <kanban string="Challenges" class="oe_background_grey" version="7.0">
140 <field name="line_ids"/>
141 <field name="user_ids"/>
143 <t t-name="kanban-box">
144 <div t-attf-class="oe_kanban_card oe_kanban_goal oe_kanban_global_click">
145 <div class="oe_dropdown_toggle oe_dropdown_kanban">
146 <span class="oe_e">í</span>
147 <ul class="oe_dropdown_menu">
148 <li><a type="edit">Configure Challenge</a></li>
151 <div class="oe_kanban_content">
153 <h4><field name="name"/></h4>
154 <div class="oe_kanban_project_list">
155 <a type="action" name="%(goals_from_challenge_act)d" style="margin-right: 10px">
156 <span t-if="record.line_ids.raw_value.length gt 1"><t t-esc="record.line_ids.raw_value.length"/> Goals</span>
157 <span t-if="record.line_ids.raw_value.length lt 2"><t t-esc="record.line_ids.raw_value.length"/> Goal</span>
160 <div class="oe_kanban_badge_avatars">
161 <t t-foreach="record.user_ids.raw_value.slice(0,11)" t-as="member">
162 <img t-att-src="kanban_image('res.users', 'image_small', member)" t-att-data-member_id="member"/>
173 <record id="challenge_list_action" model="ir.actions.act_window">
174 <field name="name">Challenges</field>
175 <field name="res_model">gamification.challenge</field>
176 <field name="view_mode">kanban,tree,form</field>
177 <field name="context">{'search_default_inprogress':True, 'default_inprogress':True}</field>
178 <field name="help" type="html">
179 <p class="oe_view_nocontent_create">
180 Click to create a challenge.
183 Assign a list of goals to chosen users to evaluate them.
184 The challenge can use a period (weekly, monthly...) for automatic creation of goals.
185 The goals are created for the specified users or member of the group.
189 <!-- Specify form view ID to avoid selecting view_challenge_wizard -->
190 <record id="challenge_list_action_view1" model="ir.actions.act_window.view">
191 <field eval="1" name="sequence"/>
192 <field name="view_mode">kanban</field>
193 <field name="act_window_id" ref="challenge_list_action"/>
194 <field name="view_id" ref="view_challenge_kanban"/>
196 <record id="challenge_list_action_view2" model="ir.actions.act_window.view">
197 <field eval="10" name="sequence"/>
198 <field name="view_mode">form</field>
199 <field name="act_window_id" ref="challenge_list_action"/>
200 <field name="view_id" ref="challenge_form_view"/>
204 <record id="challenge_line_list_view" model="ir.ui.view">
205 <field name="name">Challenge line list</field>
206 <field name="model">gamification.challenge.line</field>
207 <field name="arch" type="xml">
208 <tree string="Challenge Lines" >
209 <field name="definition_id"/>
210 <field name="target_goal"/>
216 <record id="challenge_search_view" model="ir.ui.view">
217 <field name="name">Challenge Search</field>
218 <field name="model">gamification.challenge</field>
219 <field name="arch" type="xml">
220 <search string="Search Challenges">
221 <filter name="inprogress" string="Running Challenges"
222 domain="[('state', '=', 'inprogress')]"/>
223 <filter name="hr_challenges" string="HR Challenges"
224 domain="[('category', '=', 'hr')]"/>
226 <group expand="0" string="Group By...">
227 <filter string="State" domain="[]" context="{'group_by':'state'}"/>
228 <filter string="Period" domain="[]" context="{'group_by':'period'}"/>
235 <record id="view_challenge_wizard" model="ir.ui.view">
236 <field name="name">Challenge Wizard</field>
237 <field name="model">gamification.challenge</field>
238 <field name="arch" type="xml">
239 <form string="Challenge" version="7.0">
240 <field name="reward_failure" invisible="1"/>
241 <div class="oe_title">
242 <h1><field name="name" nolabel="1" readonly="1"/></h1>
244 <field name="description" nolabel="1" readonly="1" />
246 <field name="start_date" readonly="1" />
247 <field name="end_date" readonly="1" />
248 <field name="user_ids" string="Participating" readonly="1" widget="many2many_tags" />
249 <field name="invited_user_ids" string="Invited" readonly="1" widget="many2many_tags" />
251 <group string="Goals">
252 <field name="line_ids" nolabel="1" readonly="1" colspan="4">
253 <tree string="Challenge Lines" version="7.0" editable="bottom" >
254 <field name="sequence" widget="handle"/>
255 <field name="definition_id"/>
256 <field name="condition"/>
257 <field name="target_goal"/>
258 <field name="definition_full_suffix"/>
262 <group string="Reward">
263 <div class="oe_grey" attrs="{'invisible': ['|',('reward_id','!=',False),('reward_first_id','!=',False)]}">
264 There is no reward upon completion of this challenge.
266 <group attrs="{'invisible': [('reward_id','=',False),('reward_first_id','=',False)]}">
267 <field name="reward_id" readonly="1" attrs="{'invisible': [('reward_first_id','=', False)]}" />
268 <field name="reward_first_id" readonly="1" attrs="{'invisible': [('reward_first_id','=', False)]}" />
269 <field name="reward_second_id" readonly="1" attrs="{'invisible': [('reward_second_id','=', False)]}" />
270 <field name="reward_third_id" readonly="1" attrs="{'invisible': [('reward_third_id','=', False)]}" />
272 <div class="oe_grey" attrs="{'invisible': [('reward_failure','=',False)]}">
273 Even if the challenge is failed, best challengers will be rewarded
278 <button string="Accept" type="object" name="accept_challenge" class="oe_highlight" />
279 <button string="Reject" type="object" name="discard_challenge"/> or
280 <button string="reply later" special="cancel" class="oe_link"/>
287 <record id="challenge_wizard" model="ir.actions.act_window">
288 <field name="name">Challenge Description</field>
289 <field name="res_model">gamification.challenge</field>
290 <field name="view_type">form</field>
291 <field name="view_id" ref="view_challenge_wizard"/>
292 <field name="target">new</field>