Debian Codegraph @

addons/hr_holidays/views/hr_leave_views.xml

raw symbols SCIP
1 <?xml version='1.0' encoding='UTF-8' ?>
2 <odoo>
3
4 <record id="view_evaluation_report_graph" model="ir.ui.view">
5 <field name="name">hr.holidays.graph</field>
6 <field name="model">hr.leave</field>
7 <field name="arch" type="xml">
8 <graph string="Appraisal Analysis" sample="1">
9 <field name="employee_id"/>
10 <field name="holiday_status_id"/>
11 <field name="date_from"/>
12 <field name="number_of_days" type="measure"/>
13 </graph>
14 </field>
15 </record>
16
17 <record id="view_hr_holidays_filter" model="ir.ui.view">
18 <field name="name">hr.holidays.filter</field>
19 <field name="model">hr.leave</field>
20 <field name="arch" type="xml">
21 <search string="Search Time Off">
22 <field name="employee_id"/>
23 <field name="holiday_status_id"/>
24 <field name="name"/>
25 <field name="activity_user_id" string="Activities of"/>
26 <field name="activity_type_id" string="Activity type"/>
27 <filter domain="[
28 ('state','in',['confirm']),
29 '|',
30 ('employee_id.user_id', '!=', uid),
31 '&amp;',
32 ('employee_id.user_id', '=', uid),
33 ('employee_id.leave_manager_id', '=', uid)]"
34 string="Waiting For Me"
35 name="waiting_for_me"
36 groups="hr_holidays.group_hr_holidays_responsible,!hr_holidays.group_hr_holidays_user"/>
37 <filter domain="[
38 ('state','in',['confirm','validate1']),
39 '|',
40 ('employee_id.user_id', '!=', uid),
41 '|',
42 '&amp;',
43 ('state','=','confirm'),
44 ('holiday_status_id.leave_validation_type','=','hr'),
45 ('state','=','validate1')]"
46 string="Waiting For Me"
47 name="waiting_for_me_manager"
48 groups="hr_holidays.group_hr_holidays_user"/>
49 <separator/>
50 <filter domain="[('state', '=', 'confirm')]" string="First Approval" name="approve"/>
51 <filter domain="[('state', '=', 'validate1')]" string="Second Approval" name="second_approval"/>
52 <filter domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="to_approve"/>
53 <filter string="Approved" domain="[('state', '=', 'validate')]" name="validated"/>
54 <filter name="cancelled_leaves" string="Cancelled" domain="[('state', '=', 'cancel')]"/>
55 <filter name="refused_leaves" string="Refused" domain="[('state', '=', 'refuse')]"/>
56 <separator/>
57 <filter string="My Time Off" name="my_leaves" domain="[('employee_id.user_id', '=', uid)]"/>
58 <filter string="My Team" name="my_team" domain="['|', ('employee_id.leave_manager_id', '=', uid), ('employee_id.user_id', '=', uid)]" help="Time off of people you are manager of"/>
59 <filter string="My Department" name="department"
60 domain="[('employee_id.member_of_department', '=', True)]"
61 help="My Department"/>
62 <separator/>
63 <filter name="filter_date_from" date="date_from" default_period="year" string="Start Date"/>
64 <separator/>
65 <filter invisible="1" string="My Activities" name="filter_activities_my"
66 domain="[('activity_user_id', '=', uid)]"/>
67 <separator invisible="1"/>
68 <filter invisible="1" string="Late Activities" name="activities_overdue"
69 domain="[('my_activity_date_deadline', '&lt;', 'today')]"
70 help="Show all records whose next activity date is past"/>
71 <filter invisible="1" string="Today Activities" name="activities_today"
72 domain="[('my_activity_date_deadline', '=', 'today')]"/>
73 <filter invisible="1" string="Future Activities" name="activities_upcoming_all"
74 domain="[('my_activity_date_deadline', '&gt;', 'today')
75 ]"/>
76 <group>
77 <filter name="group_employee" string="Employee" context="{'group_by':'employee_id'}"/>
78 <filter name="group_type" string="Type" context="{'group_by':'holiday_status_id'}"/>
79 <filter name="group_state" string="Status" context="{'group_by': 'state'}"/>
80 <separator/>
81 <filter name="group_date_from" string="Date" context="{'group_by':'date_from'}"/>
82 </group>
83 <searchpanel>
84 <field name="state" string="Status"/>
85 <field name="department_id" string="Department" icon="fa-users"/>
86 </searchpanel>
87 </search>
88 </field>
89 </record>
90
91 <record id="hr_leave_view_kanban" model="ir.ui.view">
92 <field name="name">hr.leave.view.kanban</field>
93 <field name="model">hr.leave</field>
94 <field name="arch" type="xml">
95 <kanban sample="1" class="o_holidays_view_kanban" js_class="time_off_kanban_dashboard">
96 <header>
97 <button type="action"
98 name="%(hr_holidays.action_hr_leave_generate_multi_wizard)d"
99 string="New Group Time Off" class="btn btn-secondary"
100 groups="hr_holidays.group_hr_holidays_responsible" display="always"
101 />
102 </header>
103 <field name="supported_attachment_ids_count"/>
104 <field name="state"/>
105 <field name="employee_id"/>
106 <field name="leave_type_request_unit"/>
107 <field name="request_unit_hours"/>
108 <field name="request_unit_half"/>
109 <field name="request_date_from"/>
110 <field name="request_hour_from"/>
111 <field name="request_hour_to"/>
112 <field name="request_date_to"/>
113 <field name="can_approve"/>
114 <field name="can_validate"/>
115 <field name="can_refuse"/>
116 <field name="request_date_from_period"/>
117 <field name="request_date_to_period"/>
118 <field name="holiday_status_requires_allocation"/>
119 <templates>
120 <t t-name="card" class="g-0">
121 <div class="o_hr_holidays_kanban w-100">
122 <widget name="web_ribbon" title="To Approve" bg_color="text-bg-warning" invisible="state != 'confirm'"/>
123 <widget name="web_ribbon" title="To Validate" bg_color="text-bg-warning" invisible="state != 'validate1'"/>
124 <widget name="web_ribbon" title="Cancelled" bg_color="text-bg-danger" invisible="state != 'cancel'"/>
125 <widget name="web_ribbon" title="Refused" bg_color="bg-danger" invisible="state != 'refuse'"/>
126 <widget name="web_ribbon" title="Approved" bg_color="bg-success" invisible="state != 'validate'"/>
127 <aside>
128 <img t-att-src="'/web/image/hr.employee.public/' + record.employee_id.raw_value + '/avatar_128'"
129 class="o_image_64_cover float-start me-2" alt="Employee's image"/>
130 </aside>
131 <main class="h-100">
132 <div class="justify-content-center o_holidays_kanban_card">
133 <div class="d-flex flex-row">
134 <div class="col-12 align-items-center o_hr_holidays_value">
135 <div class="col-4 o_hr_holidays_card">
136 <field class="fw-bold fs-3 mb-2" name="employee_id"/>
137 </div>
138 <div class="col-2 o_hr_holidays_name">
139 <field name="holiday_status_id" class="fw-bold"/>
140 <div class="d-flex flex-row">
141 <t t-set="same_day" t-value="record.request_date_from.raw_value == record.request_date_to.raw_value"/>
142 <t t-set="leave_unit" t-value="record.leave_type_request_unit.raw_value"/>
143 <t t-out="luxon.DateTime.fromISO(record.request_date_from.raw_value).toLocaleString({ month: 'short', day: 'numeric'})"/>
144 <t t-if="leave_unit == 'day'">
145 <t t-if="!same_day">
146 <span class="mx-1">–</span>
147 <t t-out="luxon.DateTime.fromISO(record.request_date_to.raw_value).toLocaleString({ month: 'short', day: 'numeric'})"/>
148 </t>
149 </t>
150 <t t-elif="leave_unit == 'half_day'">
151 <t t-set="same_period" t-value="record.request_date_from_period.raw_value == record.request_date_to_period.raw_value"/>
152 <span class="mx-1">-</span>
153 <t t-out="record.request_date_from_period.value"/>
154 <t t-if="same_day">
155 <t t-if="!same_period">
156 <span class="mx-1">–</span>
157 <t t-out="record.request_date_to_period.value"/>
158 </t>
159 </t>
160 <t t-else="">
161 <span class="mx-1">–</span>
162 <t t-out="luxon.DateTime.fromISO(record.request_date_to.raw_value).toLocaleString({ month: 'short', day: 'numeric'})"/>
163 <span class="mx-1">-</span>
164 <t t-out="record.request_date_to_period.value"/>
165 </t>
166 </t>
167 <t t-elif="leave_unit == 'hour'">
168 <span class="mx-1">-</span>
169 <field name="request_hour_from" widget="float_time_selection"/>
170 <span class="mx-1">–</span>
171 <t t-if="!same_day">
172 <t t-out="luxon.DateTime.fromISO(record.request_date_to.raw_value).toLocaleString({ month: 'short', day: 'numeric'})"/>
173 <span class="mx-1">-</span>
174 </t>
175 <field name="request_hour_to" widget="float_time_selection"/>
176 </t>
177 </div>
178 </div>
179 <div class="col-2 o_hr_holidays_card">
180 <div class="fw-bold d-flex me-1">
181 <field name="duration_display"/>
182 </div>
183 Amount
184 </div>
185 <div class="col-2 o_hr_holidays_card">
186 <div t-if="record.holiday_status_requires_allocation.raw_value"> <!-- To keep the same space-->
187 <div class="fw-bold d-flex gap-1 me-1">
188 <field name="virtual_remaining_leaves" widget="float" digits="[3,2]"/>
189 /
190 <field name="max_leaves" widget="float" digits="[3,2]"/>
191 </div>
192 <span>
193 Current balance
194 </span>
195 </div>
196 </div>
197 <div class="col-2 o_hr_holidays_button flex-wrap d-flex pe-4 gap-2 justify-content-start">
198 <button
199 name="action_approve" type="object" class="btn btn-primary"
200 t-if="record.can_approve.raw_value">
201 Approve
202 </button>
203 <button
204 name="action_approve" type="object" class="btn btn-primary"
205 t-if="record.can_validate.raw_value and !record.can_approve.raw_value">
206 Validate
207 </button>
208 <button
209 name="action_refuse" type="object" class="btn btn-secondary"
210 t-if="record.can_refuse.raw_value">
211 Refuse
212 </button>
213 </div>
214 </div>
215 </div>
216 </div>
217 </main>
218 </div>
219 <div class="f-flex flex-row o_hr_holidays_kanban_mobile w-100">
220 <main>
221 <div class="flex flex-grow-1 align-items-start mb-1">
222 <div class="mb-1 d-flex align-items-center gap-2 hr_leave_kanban_title">
223 <field name="employee_id" widget="many2one_avatar_employee"/>
224 <field name="employee_id" class="fw-bold w-100"/>
225 <span
226 style="min-width: fit-content;"
227 t-attf-class="rounded-pill badge flex-shrink-1 text-bg-{{
228 record.state.raw_value == 'validate' ? 'success' :
229 ['confirm', 'validate1'].includes(record.state.raw_value) ?
230 'warning' : 'danger' }}"
231 t-out="record.state.value"/>
232 </div>
233 <div class="d-flex flex-row">
234 <div id="date_part" class="d-flex flex-row"> <!-- To be override in my_kanban-->
235 <t t-set="same_day" t-value="record.request_date_from.raw_value == record.request_date_to.raw_value"/>
236 <t t-set="leave_unit" t-value="record.leave_type_request_unit.raw_value"/>
237 <t t-out="luxon.DateTime.fromISO(record.request_date_from.raw_value).toLocaleString({ month: 'short', day: 'numeric'})"/>
238 <t t-if="leave_unit == 'day'">
239 <t t-if="!same_day">
240 <span class="mx-1">–</span>
241 <t t-out="luxon.DateTime.fromISO(record.request_date_to.raw_value).toLocaleString({ month: 'short', day: 'numeric'})"/>
242 </t>
243 </t>
244 <t t-elif="leave_unit == 'half_day'">
245 <t t-set="same_period" t-value="record.request_date_from_period.raw_value == record.request_date_to_period.raw_value"/>
246 <span class="mx-1">-</span>
247 <t t-out="record.request_date_from_period.value"/>
248 <t t-if="same_day">
249 <t t-if="!same_period">
250 <span class="mx-1">–</span>
251 <t t-out="record.request_date_to_period.value"/>
252 </t>
253 </t>
254 <t t-else="">
255 <span class="mx-1">–</span>
256 <t t-out="luxon.DateTime.fromISO(record.request_date_to.raw_value).toLocaleString({ month: 'short', day: 'numeric'})"/>
257 <span class="mx-1"><t t-out="record.request_date_to_period.value"/></span>
258 </t>
259 </t>
260 <t t-elif="leave_unit == 'hour'">
261 <span class="mx-1">-</span>
262 <field name="request_hour_from" widget="float_time_selection"/>
263 <span class="mx-1">–</span>
264 <t t-if="!same_day">
265 <t t-out="luxon.DateTime.fromISO(record.request_date_to.raw_value).toLocaleString({ month: 'short', day: 'numeric'})"/>
266 <span class="mx-1">-</span>
267 </t>
268 <field name="request_hour_to" widget="float_time_selection"/>
269 </t>
270 </div>
271 </div>
272 <field name="holiday_status_id" class="text-muted"/>
273 <span class="text-muted">
274 (<field name="duration_display"/>)
275 </span>
276 </div>
277 </main>
278 <bottom class="d-flex justify-content-end gap-2 mt-0">
279 <button t-if="record.can_approve.raw_value" name="action_approve" type="object" class="btn btn-sm btn-primary py-0"
280 groups="hr_holidays.group_hr_holidays_user">
281 Approve
282 </button>
283 <button t-if="record.can_validate.raw_value and !record.can_approve.raw_value" name="action_approve" type="object" class="btn btn-sm btn-primary py-0"
284 groups="hr_holidays.group_hr_holidays_manager">
285 Validate
286 </button>
287 <button t-if="record.can_refuse.raw_value" name="action_refuse" type="object" class="btn btn-sm btn-secondary py-0"
288 groups="hr_holidays.group_hr_holidays_user">
289 Refuse
290 </button>
291 <button t-if="record.supported_attachment_ids_count.raw_value > 0" name="action_documents" type="object" class="btn btn-link btn-sm ps-0 text-danger">
292 <i class="fa fa-paperclip"> <field name="supported_attachment_ids_count" nolabel="1"/></i>
293 </button>
294 </bottom>
295 </div>
296 </t>
297 </templates>
298 </kanban>
299 </field>
300 </record>
301
302 <record id="hr_leave_view_activity" model="ir.ui.view">
303 <field name="name">hr.leave.view.activity</field>
304 <field name="model">hr.leave</field>
305 <field name="arch" type="xml">
306 <activity string="Time Off Request">
307 <field name="employee_id"/>
308 <templates>
309 <div t-name="activity-box">
310 <img class="rounded" t-att-src="activity_image('hr.employee', 'avatar_128', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
311 <div class="ms-2 flex-grow-1">
312 <div class="d-flex justify-content-between">
313 <field name="name" class="o_text_block o_text_bold"/>
314 <div class="text-muted text-nowrap">(<field name="number_of_days"/> days)</div>
315 </div>
316 <div class="text-muted">
317 <field name="holiday_status_id" display="full"/>
318 <field name="date_from"/> <i class="fa fa-long-arrow-right" title="to" /> <field name="date_to"/>
319 </div>
320 </div>
321 </div>
322 </templates>
323 </activity>
324 </field>
325 </record>
326
327 <record id="hr_leave_view_form" model="ir.ui.view">
328 <field name="name">hr.leave.view.form</field>
329 <field name="model">hr.leave</field>
330 <field name="priority">32</field>
331 <field name="arch" type="xml">
332 <form string="Time Off Request" class="o_hr_leave_form" duplicate="false">
333 <field name="employee_id" invisible="1"/> <!-- for the employee's default value-->
334 <field name="user_id" invisible="1"/> <!-- for conditional rendering of buttons on card -->
335 <header>
336 <button string="Approve" name="action_approve" type="object" class="oe_highlight" invisible="not can_approve or not id"/>
337 <button string="Validate" name="action_approve" invisible="not can_validate or can_approve or not id" type="object" class="oe_highlight"/>
338 <button string="Back to Approval" name="action_back_to_approval" type="object" invisible="not can_back_to_approve or not id"/>
339 <button string="Refuse" name="action_refuse" type="object" invisible="not can_refuse or not id"/>
340 <button string="Cancel" name="action_cancel" type="object" invisible="not can_cancel or not id" />
341 <field name="state" widget="statusbar" statusbar_visible="confirm,validate,validate1" invisible="validation_type != 'both'"/>
342 <field name="state" widget="statusbar" statusbar_visible="confirm,validate" invisible="validation_type == 'both'"/>
343 </header>
344 <sheet>
345 <field name="dashboard_warning_message" class="alert alert-danger d-flex mt-2" role="alert" style="white-space: pre-wrap;" invisible="not dashboard_warning_message"/>
346 <field name="leave_type_increases_duration" class="alert alert-info d-flex mt-2" role="alert" style="white-space: pre-wrap;" invisible="not leave_type_increases_duration"/>
347 <div class="o_hr_leave_content row">
348 <div class="o_hr_leave_column col_left col-md-6 col-12">
349 <widget name="web_ribbon" title="Cancelled" bg_color="text-bg-danger" invisible="state != 'cancel'"/>
350 <div name="title" class="o_hr_leave_title" invisible="1">
351 <field name="display_name" invisible="not holiday_status_id"/>
352 </div>
353 <group name="col_left" class="m-0">
354 <field name="holiday_status_id" force_save="1"
355 domain="[
356 '|',
357 ('requires_allocation', '=', False),
358 '&amp;',
359 ('has_valid_allocation', '=', True),
360 '|',
361 ('allows_negative', '=', True),
362 '&amp;',
363 ('virtual_remaining_leaves', '&gt;', 0),
364 ('allows_negative', '=', False),
365 ]"
366 context="{'employee_id': employee_id, 'default_date_from': date_from, 'default_date_to': date_to}"
367 options="{'no_create': True, 'request_type': 'leave'}"
368 readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"/>
369 <label for="request_date_from" invisible="not request_unit_half and not request_unit_hours" string="Date" />
370 <label for="request_date_from" invisible="request_unit_half or request_unit_hours" string="Dates" />
371 <div id="full_date" class="o_row">
372 <field
373 name="request_date_from"
374 widget="daterange"
375 readonly="state != 'confirm'"
376 required="not date_from or not date_to"
377 options="{'end_date_field': 'request_date_to', 'always_range': '1'}"/>
378 <field name="request_date_to" invisible="1"/> <!-- For Form view test-->
379 <div>
380 ( <field name="duration_display" readonly="1" class="w-auto"/> )
381 </div>
382 </div>
383 <!-- half day or custom hours-->
384 <label for="request_date_from_period" invisible="not request_unit_half" string="Day Period"/>
385 <div class="o_row" invisible="not request_unit_half">
386 <field name="request_date_from_period" invisible="not request_unit_half" required="request_unit_half" readonly="state != 'confirm'" class="o_hr_narrow_field me-2"/>
387 <field name="request_date_to_period" invisible="not request_unit_half" required="request_unit_half" readonly="state != 'confirm'" class="o_hr_narrow_field"/>
388 </div>
389 <label for="request_hour_from" invisible="not request_unit_hours" string="Hours"/>
390 <div class="o_row" invisible="not request_unit_hours">
391 <field name="request_hour_from" readonly="state == 'validate'" required="request_unit_hours" widget="float_time_selection" class="o_hr_narrow_field me-2"/>
392 <field name="request_hour_to" readonly="state == 'validate'" required="request_unit_hours" widget="float_time_selection" class="o_hr_narrow_field"/>
393 </div>
394 <div colspan="2" class="alert alert-info" role="alert" invisible="not request_unit_hours or not tz_mismatch or dashboard_warning_message">
395 <span>The employee has a different timezone than yours! Here dates and times are displayed in the employee's work timezone</span>
396 (<field name="tz" class="oe_inline fw-bold"/>).
397 <div>For your reference, the equivalent times in your timezone are displayed below.</div>
398 </div>
399 <label for="date_from" string="Your Timezone" invisible="not request_unit_hours or not tz_mismatch"/>
400 <div class="o_row o_row_readonly" invisible="not request_unit_hours or not tz_mismatch">
401 <label for="date_from" string="From" />
402 <field name="date_from" readonly="1" widget="datetime"/>
403 <label for="date_to" string="To" />
404 <field name="date_to" readonly="1"/>
405 </div>
406 <field name="name" readonly="state != 'confirm'" widget="text" nolabel="1" colspan="2" placeholder="No description provided" />
407 </group>
408 <group>
409 <field name="supported_attachment_ids" widget="many2many_binary" nolabel="1" invisible="state != 'confirm'" colspan="2"/>
410 </group>
411 </div>
412 <div class="o_hr_leave_column col_right col-md-6 col-12">
413 <widget name="hr_leave_stats"/>
414 </div>
415 </div>
416 </sheet>
417 <div class="o_attachment_preview"/>
418 <chatter reload_on_post="True" reload_on_attachment="True"/>
419 </form>
420 </field>
421 </record>
422
423 <record id="hr_leave_view_form_dashboard" model="ir.ui.view">
424 <field name="name">hr.leave.view.form.dashboard</field>
425 <field name="model">hr.leave</field>
426 <field name="inherit_id" ref="hr_holidays.hr_leave_view_form"/>
427 <field name="mode">primary</field>
428 <field name="priority">100</field>
429 <field name="arch" type="xml">
430 <field name="holiday_status_id" position="before">
431 <field name="employee_id" widget="many2one_avatar_employee" readonly="1"/>
432 </field>
433 <xpath expr="//header" position="attributes">
434 <attribute name="invisible">1</attribute>
435 </xpath>
436 <xpath expr="//div[hasclass('col_right')]" position="replace"/>
437 <xpath expr="//chatter" position="attributes">
438 <attribute name="invisible">1</attribute>
439 </xpath>
440 <xpath expr="//div[hasclass('o_attachment_preview')]" position="attributes">
441 <attribute name="invisible">1</attribute>
442 </xpath>
443 </field>
444 </record>
445
446 <record id="hr_leave_view_form_dashboard_new_time_off" model="ir.ui.view">
447 <field name="name">hr.leave.view.form.dashboard.new.time.off</field>
448 <field name="model">hr.leave</field>
449 <field name="inherit_id" ref="hr_holidays.hr_leave_view_form_dashboard"/>
450 <field name="mode">primary</field>
451 <field name="priority">17</field>
452 <field name="arch" type="xml">
453 <xpath expr="//group[@name='col_left']" position="attributes">
454 <attribute name="colspan">5</attribute>
455 </xpath>
456 <xpath expr="//div[hasclass('o_hr_leave_content')]" position="attributes">
457 <attribute name="class" remove="row my-n4" separator=" "/>
458 </xpath>
459 <xpath expr="//div[hasclass('o_hr_leave_column')]" position="attributes">
460 <attribute name="class" remove="col_left col-md-6" separator=" "/>
461 </xpath>
462 <xpath expr="//div[hasclass('o_hr_leave_content')]" position="before">
463 <widget name="web_ribbon" title="Refused" bg_color="bg-danger" invisible="state != 'refuse' or not id"/>
464 <widget name="web_ribbon" title="Approved" bg_color="bg-success" invisible="state != 'validate' or not id"/>
465 </xpath>
466 </field>
467 </record>
468
469 <record id="hr_leave_view_form_dashboard_manager_new_time_off" model="ir.ui.view">
470 <field name="name">hr.leave.view.form.dashboard.new.time.off</field>
471 <field name="model">hr.leave</field>
472 <field name="inherit_id" ref="hr_holidays.hr_leave_view_form_dashboard_new_time_off"/>
473 <field name="mode">primary</field>
474 <field name="priority">17</field>
475 <field name="arch" type="xml">
476 <xpath expr="//field[@widget='many2one_avatar_employee']" position="attributes">
477 <attribute name="readonly">0</attribute>
478 </xpath>
479 <field name="holiday_status_id" position="before">
480 <field name="user_id" invisible="1"/> <!-- Used in HolidaysFormViewDialog -->
481 </field>
482 </field>
483 </record>
484
485 <record id="hr_leave_view_dashboard" model="ir.ui.view">
486 <field name="name">hr.leave.view.dashboard</field>
487 <field name="model">hr.leave</field>
488 <field name="arch" type="xml">
489 <calendar js_class="time_off_calendar_dashboard"
490 string="Time Off Request"
491 form_view_id="%(hr_holidays.hr_leave_view_form_dashboard_new_time_off)d"
492 event_open_popup="true"
493 date_start="date_from"
494 date_stop="date_to"
495 quick_create="0"
496 show_date_picker="0"
497 show_unusual_days="True"
498 color="color"
499 hide_time="True"
500 mode="year">
501 <field name="display_name" string=""/>
502 <field name="holiday_status_id" filters="1" invisible="1" color="color"/>
503 <field name="state" invisible="1"/>
504 <field name="is_hatched" invisible="1" />
505 <field name="is_striked" invisible="1"/>
506 </calendar>
507 </field>
508 </record>
509
510 <record id="hr_leave_employee_view_dashboard" model="ir.ui.view">
511 <field name="name">hr.leave.view.dashboard</field>
512 <field name="model">hr.leave</field>
513 <field name="arch" type="xml">
514 <calendar string="Time Off Request"
515 js_class="time_off_calendar_dashboard"
516 form_view_id="%(hr_holidays.hr_leave_view_form_dashboard_new_time_off)d"
517 event_open_popup="true"
518 date_start="date_from"
519 date_stop="date_to"
520 mode="year"
521 quick_create="0"
522 show_date_picker="0"
523 show_unusual_days="True"
524 color="color"
525 hide_time="True">
526 <field name="display_name" string=""/>
527 <field name="holiday_status_id" filters="1" invisible="1" color="color"/>
528 <field name="state" invisible="1"/>
529 <field name="is_hatched" invisible="1" />
530 <field name="is_striked" invisible="1"/>
531 </calendar>
532 </field>
533 </record>
534
535 <record id="hr_leave_view_form_manager" model="ir.ui.view">
536 <field name="name">hr.leave.view.form.manager</field>
537 <field name="model">hr.leave</field>
538 <field name="inherit_id" ref="hr_leave_view_form"/>
539 <field name="mode">primary</field>
540 <field name="priority">16</field>
541 <field name="arch" type="xml">
542 <xpath expr="//div[@name='title']" position="attributes">
543 <attribute name="invisible">0</attribute>
544 </xpath>
545 <xpath expr="//field[@name='holiday_status_id']" position="before">
546 <field name="employee_id" groups="hr_holidays.group_hr_holidays_responsible" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']" widget="many2one_avatar_employee"/>
547 <field name="company_id" groups="base.group_multi_company"/>
548 <field name="department_id" groups="hr_holidays.group_hr_holidays_responsible" readonly="1"/>
549 </xpath>
550 </field>
551 </record>
552
553 <record id="hr_leave_view_calendar" model="ir.ui.view">
554 <field name="name">hr.leave.view.calendar</field>
555 <field name="model">hr.leave</field>
556 <field name="arch" type="xml">
557 <calendar js_class="time_off_calendar_hr_leave"
558 string="Time Off Request"
559 form_view_id="%(hr_holidays.hr_leave_view_form_dashboard_manager_new_time_off)d"
560 event_open_popup="true"
561 date_start="date_from"
562 date_stop="date_to"
563 mode="month"
564 show_unusual_days="True"
565 quick_create="0"
566 color="color">
567 <field name="holiday_status_id" color="color" filters="1" invisible="1"/>
568 <field name="employee_id" filters="1" widget="many2one_avatar_employee"/>
569 <field name="name"/>
570 <field name="state" invisible="1"/>
571 <field name="is_hatched" invisible="1" />
572 <field name="is_striked" invisible="1"/>
573 <field name="state" invisible="1"/>
574 </calendar>
575 </field>
576 </record>
577
578 <record id="hr_leave_view_tree" model="ir.ui.view">
579 <field name="name">hr.holidays.view.list</field>
580 <field name="model">hr.leave</field>
581 <field name="arch" type="xml">
582 <list string="Time Off Requests" sample="1" duplicate="false" js_class="hr_holidays_payslip_list">
583 <header>
584 <button type="action"
585 name="%(hr_holidays.action_hr_leave_generate_multi_wizard)d"
586 string="New Group Time Off" class="btn btn-secondary"
587 groups="hr_holidays.group_hr_holidays_responsible" display="always"
588 />
589 <button type="object"
590 name="action_approve"
591 string="Approve"
592 icon="fa-thumbs-up"
593 class="btn btn-outline-success"
594 />
595 <button type="object"
596 name="action_refuse"
597 string="Refuse"
598 icon="fa-times"
599 class="btn btn-outline-danger"
600 />
601 </header>
602 <field name="employee_id" widget="many2one_avatar_employee" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']" />
603 <field name="department_id" optional="hidden" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"/>
604 <field name="holiday_status_id" class="fw-bold" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"/>
605 <field name="date_from" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"/>
606 <field name="date_to" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"/>
607 <field name="duration_display" string="Duration"/>
608 <field name="name" optional="hidden"/>
609 <field name="state" widget="badge" decoration-warning="state in ('confirm','validate1')" decoration-success="state == 'validate'" decoration-danger="state == 'refuse'"/>
610 <field name="active_employee" column_invisible="True"/>
611 <field name="user_id" column_invisible="True"/>
612 <field name="message_needaction" column_invisible="True"/>
613 <button string="Approve" name="action_approve" type="object"
614 icon="fa-thumbs-up"
615 invisible="not can_approve"/>
616 <button string="Validate" name="action_approve" type="object"
617 icon="fa-check"
618 invisible="not can_validate or can_approve"/>
619 <button string="Refuse" name="action_refuse" type="object"
620 icon="fa-times"
621 invisible="not can_refuse"/>
622 <field name="company_id" optional="hidden" groups="base.group_multi_company"/>
623 <field name="activity_exception_decoration" widget="activity_exception"/>
624 </list>
625 </field>
626 </record>
627
628 <record id="hr_leave_view_tree_my" model="ir.ui.view">
629 <field name="name">hr.holidays.view.list</field>
630 <field name="model">hr.leave</field>
631 <field name="inherit_id" ref="hr_leave_view_tree"/>
632 <field name="mode">primary</field>
633 <field name="priority">32</field>
634 <field name="arch" type="xml">
635 <xpath expr="//list" position="attributes">
636 <attribute name="default_order">date_from DESC</attribute>
637 </xpath>
638 <xpath expr="//field[@name='employee_id']" position="attributes">
639 <attribute name="column_invisible">1</attribute>
640 </xpath>
641 <xpath expr="//field[@name='department_id']" position="attributes">
642 <attribute name="column_invisible">1</attribute>
643 </xpath>
644 <xpath expr="//button[@name='%(hr_holidays.action_hr_leave_generate_multi_wizard)d']" position="attributes">
645 <attribute name="invisible">1</attribute>
646 </xpath>
647 </field>
648 </record>
649
650 <record id="hr_leave_view_search_my" model="ir.ui.view">
651 <field name="name">hr.holidays.view.search.my</field>
652 <field name="model">hr.leave</field>
653 <field name="inherit_id" ref="view_hr_holidays_filter"/>
654 <field name="mode">primary</field>
655 <field name="priority">32</field>
656 <field name="arch" type="xml">
657 <xpath expr="//searchpanel" position="replace"/>
658 <xpath expr="//filter[@name='department']" position="attributes">
659 <attribute name="invisible">1</attribute>
660 </xpath>
661 <xpath expr="//filter[@name='my_team']" position="attributes">
662 <attribute name="invisible">1</attribute>
663 </xpath>
664 <xpath expr="//filter[@name='my_leaves']" position="attributes">
665 <attribute name="invisible">1</attribute>
666 </xpath>
667 <xpath expr="//filter[@name='group_employee']" position="attributes">
668 <attribute name="invisible">1</attribute>
669 </xpath>
670 <xpath expr="//field[@name='employee_id']" position="attributes">
671 <attribute name="invisible">1</attribute>
672 </xpath>
673 </field>
674 </record>
675
676 <record id="hr_leave_view_search_manager" model="ir.ui.view">
677 <field name="name">hr.holidays.view.search.manager</field>
678 <field name="model">hr.leave</field>
679 <field name="inherit_id" ref="view_hr_holidays_filter"/>
680 <field name="mode">primary</field>
681 <field name="priority">33</field>
682 <field name="arch" type="xml">
683 <field name='employee_id' position="after">
684 <field name="department_id"/>
685 </field>
686 <xpath expr="//filter[@name='my_leaves']" position="attributes">
687 <attribute name="invisible">1</attribute>
688 </xpath>
689 <xpath expr="//filter[@name='group_employee']" position="attributes">
690 <attribute name="invisible">1</attribute>
691 </xpath>
692 </field>
693 </record>
694
695 <record id="hr_leave_view_search_report" model="ir.ui.view">
696 <field name="name">hr.holidays.view.search.report</field>
697 <field name="model">hr.leave</field>
698 <field name="inherit_id" ref="view_hr_holidays_filter"/>
699 <field name="mode">primary</field>
700 <field name="priority">34</field>
701 <field name="arch" type="xml">
702 <filter name="cancelled_leaves" position="replace" />
703 </field>
704 </record>
705
706 <record id="hr_leave_action_new_request" model="ir.actions.act_window">
707 <field name="name">Dashboard</field>
708 <field name="path">time-off</field>
709 <field name="res_model">hr.leave</field>
710 <field name="view_mode">calendar,list,form,activity</field>
711 <field name="domain">[('user_id', '=', uid), ('employee_id.company_id', 'in', allowed_company_ids)]</field>
712 <field name="context">{'short_name': 1, 'search_default_year': 1}</field>
713 <field name="search_view_id" ref="hr_holidays.hr_leave_view_search_my"/>
714 <field name="help" type="html">
715 <p class="o_view_nocontent_smiling_face">
716 Keep track of your requests.
717 </p><p>
718 A great way to keep track on your time off requests, sick days, and approval status.
719 </p>
720 </field>
721 </record>
722
723 <record id="hr_leave_action_new_request_view_calendar" model="ir.actions.act_window.view">
724 <field name="sequence">1</field>
725 <field name="view_mode">calendar</field>
726 <field name="act_window_id" ref="hr_leave_action_new_request"/>
727 <field name="view_id" ref="hr_leave_view_dashboard"/>
728 </record>
729
730 <record id="hr_leave_action_new_request_view_tree" model="ir.actions.act_window.view">
731 <field name="sequence">2</field>
732 <field name="view_mode">list</field>
733 <field name="act_window_id" ref="hr_leave_action_new_request"/>
734 <field name="view_id" ref="hr_leave_view_tree_my"/>
735 </record>
736
737 <record id="hr_leave_action_new_request_view_form" model="ir.actions.act_window.view">
738 <field name="sequence">3</field>
739 <field name="view_mode">form</field>
740 <field name="act_window_id" ref="hr_leave_action_new_request"/>
741 <field name="view_id" ref="hr_leave_view_form"/>
742 </record>
743
744 <record id="hr_leave_action_my_request" model="ir.actions.act_window">
745 <field name="name">Time Off Request</field>
746 <field name="res_model">hr.leave</field>
747 <field name="view_mode">form</field>
748 <field name="target">new</field>
749 </record>
750 <record id="hr_leave_action_my_request_view_form" model="ir.actions.act_window.view">
751 <field name="view_mode">form</field>
752 <field name="act_window_id" ref="hr_leave_action_my_request"/>
753 <field name="view_id" ref="hr_leave_view_form_dashboard_new_time_off"/>
754 </record>
755
756 <record id="hr_leave_view_kanban_my" model="ir.ui.view">
757 <field name="name">hr.leave.view.kanban.my</field>
758 <field name="mode">primary</field>
759 <field name="model">hr.leave</field>
760 <field name="inherit_id" ref="hr_holidays.hr_leave_view_kanban"/>
761 <field name="mode">primary</field>
762 <field name="arch" type="xml">
763 <xpath expr="//div[@id='date_part']" position="attributes">
764 <attribute name="class" add="w-100 fw-bold" separator=" "/>
765 </xpath>
766 <xpath expr="//div[@id='date_part']" position="after">
767 <span
768 style="min-width: fit-content;"
769 t-attf-class="rounded-pill badge flex-shrink-1 text-bg-{{
770 record.state.raw_value == 'validate' ? 'success' :
771 ['confirm', 'validate1'].includes(record.state.raw_value) ?
772 'warning' : 'danger' }}"
773 t-out="record.state.value"/>
774 </xpath>
775 <xpath expr="//div[hasclass('hr_leave_kanban_title')]" position="replace"/>
776 </field>
777 </record>
778
779 <record id="hr_leave_action_my" model="ir.actions.act_window">
780 <field name="name">My Time Off</field>
781 <field name="res_model">hr.leave</field>
782 <field name="path">my-time-off</field>
783 <field name="view_mode">list,form,kanban,activity</field>
784 <field name="search_view_id" ref="hr_leave_view_search_my"/>
785 <field name="view_ids" eval="[(5, 0, 0),
786 (0, 0, {'view_mode': 'kanban', 'view_id': ref('hr_leave_view_kanban_my')})]"/>
787 <field name="domain">[('user_id', '=', uid)]</field>
788 <field name="help" type="html">
789 <p class="o_view_nocontent_smiling_face">
790 Keep track of your requests.
791 </p><p>
792 A great way to keep track on your time off requests, sick days, and approval status.
793 </p>
794 </field>
795 </record>
796
797 <record id="hr_leave_action_my_view_tree" model="ir.actions.act_window.view">
798 <field name="sequence">1</field>
799 <field name="view_mode">list</field>
800 <field name="act_window_id" ref="hr_leave_action_my"/>
801 <field name="view_id" ref="hr_leave_view_tree_my"/>
802 </record>
803
804 <record id="hr_leave_action_my_view_form" model="ir.actions.act_window.view">
805 <field name="sequence">2</field>
806 <field name="view_mode">form</field>
807 <field name="act_window_id" ref="hr_leave_action_my"/>
808 <field name="view_id" ref="hr_leave_view_form"/>
809 </record>
810
811 <record id="hr_leave_action_action_approve_department" model="ir.actions.act_window">
812 <field name="name">All Time Off</field>
813 <field name="res_model">hr.leave</field>
814 <field name="path">time-off-approval</field>
815 <field name="view_mode">kanban,list,form,calendar,activity</field>
816 <field name="search_view_id" ref="hr_holidays.hr_leave_view_search_manager"/>
817 <field name="context">{
818 'search_default_waiting_for_me': 1,
819 'search_default_waiting_for_me_manager': 2,
820 'search_default_current_year': 3,
821 'hide_employee_name': 1,
822 }</field>
823 <field name="domain">[('employee_id.company_id', 'in', allowed_company_ids)]</field>
824 <field name="help" type="html">
825 <p class="o_view_nocontent_smiling_face">
826 Meet the time off dashboard.
827 </p><p>
828 A great way to keep track on employee’s time off, sick days, and approval status.
829 </p>
830 </field>
831 </record>
832
833 <record id="hr_leave_action_holiday_allocation_id" model="ir.actions.act_window">
834 <field name="name">Time Off</field>
835 <field name="res_model">hr.leave</field>
836 <field name="view_mode">list,kanban,form,calendar,activity</field>
837 <field name="search_view_id" ref="hr_holidays.hr_leave_view_search_manager"/>
838 <field name="context">{
839 'hide_employee_name': 1,
840 }
841 </field>
842 <field name="help" type="html">
843 <p class="o_view_nocontent_smiling_face">
844 Meet the time off dashboard.
845 </p><p>
846 A great way to keep track on employee’s PTOs, sick days, and approval status.
847 </p>
848 </field>
849 </record>
850
851 <record id="action_view_kanban_manager_approve" model="ir.actions.act_window.view">
852 <field name="sequence" eval="1"/>
853 <field name="view_mode">kanban</field>
854 <field name="view_id" ref="hr_leave_view_kanban"/>
855 <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
856 </record>
857 <record id="action_view_tree_manager_approve" model="ir.actions.act_window.view">
858 <field name="sequence" eval="2"/>
859 <field name="view_mode">list</field>
860 <field name="view_id" ref="hr_leave_view_tree"/>
861 <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
862 </record>
863 <record id="action_view_form_manager_approve" model="ir.actions.act_window.view">
864 <field name="sequence" eval="3"/>
865 <field name="view_mode">form</field>
866 <field name="view_id" ref="hr_leave_view_form_manager"/>
867 <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
868 </record>
869 <record id="action_view_calendar_manager_approve" model="ir.actions.act_window.view">
870 <field name="sequence" eval="4"/>
871 <field name="view_mode">calendar</field>
872 <field name="view_id" eval="False"/>
873 <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
874 </record>
875 <record id="action_view_activity_manager_approve" model="ir.actions.act_window.view">
876 <field name="sequence" eval="5"/>
877 <field name="view_mode">activity</field>
878 <field name="view_id" eval="False"/>
879 <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
880 </record>
881
882 <record id="view_holiday_pivot" model="ir.ui.view">
883 <field name="name">hr.holidays.report_pivot</field>
884 <field name="model">hr.leave</field>
885 <field name="priority">20</field>
886 <field name="arch" type="xml">
887 <pivot string="Time Off Summary" sample="1">
888 <field name="request_hour_from" invisible="1"/>
889 <field name="request_hour_to" invisible="1"/>
890 <field name="color" invisible="1"/>
891 <field name="employee_id" type="row"/>
892 <field name="date_from" type="col"/>
893 <field name="number_of_days" type="measure"/>
894 </pivot>
895 </field>
896 </record>
897
898 <record id="view_holiday_graph" model="ir.ui.view">
899 <field name="name">hr.holidays.report_graph</field>
900 <field name="model">hr.leave</field>
901 <field name="priority">20</field>
902 <field name="arch" type="xml">
903 <graph string="Time Off Summary" sample="1">
904 <field name="request_hour_from" invisible="1"/>
905 <field name="request_hour_to" invisible="1"/>
906 <field name="color" invisible="1"/>
907 <field name="employee_id"/>
908 <field name="number_of_hours" widget="float_time"/>
909 <field name="number_of_days" type="measure"/>
910 </graph>
911 </field>
912 </record>
913
914 <record id="view_holiday_list" model="ir.ui.view">
915 <field name="name">hr.holidays.report_list</field>
916 <field name="model">hr.leave</field>
917 <field name="priority">20</field>
918 <field name="arch" type="xml">
919 <list string="Time Off Summary" sample="1" duplicate="false">
920 <field name="employee_id" widget="many2one_avatar_employee"/>
921 <field name="number_of_days" string="# days" type="measure"/>
922 <field name="date_from" string="Start"/>
923 <field name="date_to" string="Stop"/>
924 <field name="name" optional="hide"/>
925 <field name="state"/>
926 </list>
927 </field>
928 </record>
929
930 <record id="action_hr_available_holidays_report" model="ir.actions.act_window">
931 <field name="name">Time Off by Employee</field>
932 <field name="res_model">hr.leave</field>
933 <field name="view_mode">list,graph,pivot,calendar,form</field>
934 <field name="search_view_id" ref="hr_holidays.view_hr_holidays_filter"/>
935 <field name="context">{'search_default_filter_date_from': 1, 'search_default_group_employee': 1,
936 'search_default_group_type': 1, 'search_default_to_approve': 1, 'search_default_validated': 1}</field>
937 <field name="domain">[('state', '!=', 'cancel')]</field>
938 <field name="help" type="html">
939 <p class="o_view_nocontent_empty_folder">
940 No Time off yet!
941 </p>
942 <p>
943 Check back later to review all your employees' time off
944 </p>
945 </field>
946 </record>
947
948 <record id="action_window_leave_pivot" model="ir.actions.act_window.view">
949 <field name="sequence" eval="4"/>
950 <field name="view_mode">pivot</field>
951 <field name="view_id" ref="view_holiday_pivot"/>
952 <field name="act_window_id" ref="action_hr_available_holidays_report"/>
953 </record>
954
955 <record id="action_window_leave_list" model="ir.actions.act_window.view">
956 <field name="sequence" eval="5"/>
957 <field name="view_mode">list</field>
958 <field name="view_id" ref="view_holiday_list"/>
959 <field name="act_window_id" ref="action_hr_available_holidays_report"/>
960 </record>
961
962 <record id="action_window_leave_graph" model="ir.actions.act_window.view">
963 <field name="sequence" eval="10"/>
964 <field name="view_mode">graph</field>
965 <field name="view_id" ref="view_holiday_graph"/>
966 <field name="act_window_id" ref="action_hr_available_holidays_report"/>
967 </record>
968
969 </odoo>