5 <record id="view_evaluation_report_graph" model="ir.ui.view">
6 <field name="name">hr.holidays.graph</field>
7 <field name="model">hr.holidays</field>
8 <field name="arch" type="xml">
9 <graph string="Appraisal Analysis" type="pivot" stacked="True">
10 <field name="employee_id" type="row"/>
11 <field name="holiday_status_id" type="row"/>
12 <field name="date_from" type="col"/>
13 <field name="number_of_days" type="measure"/>
18 <record id="view_hr_holidays_filter" model="ir.ui.view">
19 <field name="name">hr.holidays.filter</field>
20 <field name="model">hr.holidays</field>
21 <field name="arch" type="xml">
22 <search string="Search Leave">
25 <filter domain="[('state','=','draft')]" string="To Confirm"/>
26 <filter domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="approve"/>
27 <filter domain="[('state','=','validate')]" string="Validated" name="validated"/>
29 <filter name="year" string="Year" domain="[('holiday_status_id.active','=',True)]" help="Filters only on allocations and requests that belong to an holiday type that is 'active' (active field is True)"/>
31 <filter string="My Requests" name="my_leaves" domain="[('employee_id.user_id','=', uid)]" help="My Leave Requests"/>
33 <filter string="My Department Leaves" help="My Department Leaves" domain="[('department_id.manager_id','=',uid)]"/>
34 <field name="employee_id"/>
35 <field name="department_id"/>
36 <field name="holiday_status_id"/>
37 <group expand="0" string="Group By">
38 <filter name="group_name" string="Description" context="{'group_by':'name'}"/>
39 <filter name="group_employee" string="Employee" context="{'group_by':'employee_id'}"/>
40 <filter name="group_category" string="Category" context="{'group_by':'category_id'}"/>
41 <filter string="Manager" context="{'group_by':'manager_id'}"/>
42 <filter name="group_type" string="Type" context="{'group_by':'holiday_status_id'}"/>
44 <filter name="group_date_from" string="Start Month" context="{'group_by':'date_from:month'}"/>
50 <!-- Holidays: Leave Request -->
52 <record id="view_holiday_new_calendar" model="ir.ui.view">
53 <field name="name">Leave Request</field>
54 <field name="model">hr.holidays</field>
55 <field name="arch" type="xml">
56 <calendar string="Leave Request" color="employee_id"
57 date_start="date_from" date_stop="date_to"
58 quick_add="False" avatar_model="hr.employee">
59 <field name="employee_id"/>
60 <field name="holiday_status_id"/>
65 <!-- Holidays: Allocation Request -->
66 <record model="ir.ui.view" id="edit_holiday_new">
67 <field name="name">Leave Request</field>
68 <field name="model">hr.holidays</field>
69 <field name="arch" type="xml">
70 <form string="Leave Request">
71 <field name="can_reset" invisible="1"/>
72 <field name="type" invisible="1"/>
74 <button string="Confirm" name="confirm" states="draft" type="workflow" class="oe_highlight"/>
75 <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
76 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
77 <button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user"/>
78 <button string="Reset to Draft" name="reset" type="workflow"
79 attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
80 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
85 <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')], 'required': [('type', '=', 'add')]}"/>
86 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
87 <label for="number_of_days_temp" string="Duration"/>
89 <group col="3" attrs="{'invisible': [('type', '=', 'add')]}">
90 <field name="date_from" nolabel="1" on_change="onchange_date_from(date_to, date_from)" attrs="{'required':[('type', '=', 'remove')]}" class="oe_inline"/><label string="-" class="oe_inline"/>
91 <field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)" attrs="{'required':[('type', '=', 'remove')]}" class="oe_inline"/>
94 <field name="number_of_days_temp" class="oe_inline"/> days
99 <field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('type', '=', 'remove'),('state','!=','draft')]}" string="Mode" groups="base.group_hr_user" context="{'employee_id':employee_id}" />
100 <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" on_change="onchange_employee(employee_id)" groups="base.group_hr_user"/>
101 <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly': [('type', '=', 'remove'),('state','!=','draft'), ('state','!=','confirm')], 'invisible':[('holiday_type','=','employee')]}"/>
102 <field name="department_id" attrs="{'readonly':['|', ('type','=','add'),('holiday_type','=','category')],'invisible':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
105 <field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..." attrs="{'invisible': [('type', '=', 'remove')]}"/>
107 <div class="oe_chatter">
108 <field name="message_follower_ids" widget="mail_followers"/>
109 <field name="message_ids" widget="mail_thread"/>
115 <record model="ir.ui.view" id="view_holiday_allocation_tree">
116 <field name="name">hr.holidays.allocation.tree</field>
117 <field name="model">hr.holidays</field>
118 <field name="arch" type="xml">
119 <tree colors="red:state == 'refuse';blue:state == 'draft';black:state in ('confirm','validate','validate1')" string="Allocation Requests">
120 <field name="employee_id"/>
121 <field name="holiday_type"/>
122 <field name="category_id"/>
123 <field name="department_id" invisible="1"/>
124 <field name="holiday_status_id"/>
126 <field name="number_of_days" string="Allocated Days" sum="Remaining Days"/>
127 <field name="manager_id" invisible="1"/>
128 <field name="user_id" invisible="1"/>
129 <field name="date_from" invisible="1"/>
130 <!--field name="type"/-->
131 <field name="state"/>
136 <!-- Holidays: Leaves Management -->
137 <record model="ir.ui.view" id="allocation_company_new">
138 <field name="name">Leaves Management</field>
139 <field name="model">hr.holidays</field>
140 <field name="arch" type="xml">
141 <form string="Leaves Management">
143 <button string="Submit to Manager" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
144 <button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
145 <button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
146 <button string="Reset to Draft" name="reset" states="confirm" type="workflow" groups="base.group_hr_manager"/>
147 <field name="state"/>
150 <field name="holiday_status_id"/>
152 <field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
153 <field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
154 <field name="number_of_days_temp"/>
155 <field name="manager_id"/>
157 <field name="name" placeholder="Add a reason..."/>
162 <record model="ir.ui.view" id="view_holiday_simple">
163 <field name="name">hr.holidays.report_tree</field>
164 <field name="model">hr.holidays</field>
165 <field name="priority">20</field>
166 <field name="arch" type="xml">
167 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leaves Summary">
168 <field name="employee_id"/>
169 <field name="category_id" invisible="1"/>
170 <field name="department_id" invisible="1"/>
173 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
174 <field name="date_from"/>
175 <field name="date_to"/>
176 <field name="holiday_status_id"/>
177 <field name="manager_id" invisible="1"/>
178 <field name="user_id" invisible="1"/>
179 <field name="state"/>
184 <record model="ir.ui.view" id="view_holiday">
185 <field name="name">hr.holidays.tree</field>
186 <field name="model">hr.holidays</field>
187 <field name="arch" type="xml">
188 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leave Requests">
189 <field name="employee_id"/>
190 <field name="holiday_type" string="Mode" groups="base.group_no_one"/>
191 <field name="holiday_status_id"/>
193 <field name="date_from"/>
194 <field name="date_to"/>
195 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
196 <field name="state"/>
197 <field name="category_id" invisible="1"/>
198 <field name="department_id" invisible="not context.get('set_visible',False)"/>
199 <field name="manager_id" invisible="1"/>
200 <field name="user_id" invisible="1"/>
205 <menuitem name="Leaves" parent="hr.menu_hr_root" id="menu_open_ask_holidays" sequence="20"/>
207 <record model="ir.actions.act_window" id="open_ask_holidays">
208 <field name="name">Leave Request</field>
209 <field name="res_model">hr.holidays</field>
210 <field name="view_type">form</field>
211 <field name="view_id" ref="edit_holiday_new"/>
212 <field name="context">{'default_type': 'remove', 'search_default_my_leaves':1}</field>
213 <field name="domain">[('type','=','remove')]</field>
214 <field name="search_view_id" ref="view_hr_holidays_filter"/>
215 <field name="help" type="html">
216 <p class="oe_view_nocontent_create">
217 Click to create a new leave request.
219 Once you have recorded your leave request, it will be sent
220 to a manager for validation. Be sure to set the right leave
221 type (recuperation, legal holidays, sickness) and the exact
222 number of open days related to your leave.
227 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">
228 <field name="sequence" eval="2"/>
229 <field name="view_mode">tree</field>
230 <field name="view_id" ref="view_holiday"/>
231 <field name="act_window_id" ref="open_ask_holidays"/>
234 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_form">
235 <field name="sequence" eval="3"/>
236 <field name="view_mode">form</field>
237 <field name="view_id" ref="edit_holiday_new"/>
238 <field name="act_window_id" ref="open_ask_holidays"/>
241 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_calendar">
242 <field name="sequence" eval="1"/>
243 <field name="view_mode">calendar</field>
244 <field name="view_id" ref="view_holiday_new_calendar"/>
245 <field name="act_window_id" ref="open_ask_holidays"/>
248 <menuitem parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
250 <record model="ir.actions.act_window" id="request_approve_holidays">
251 <field name="name">Requests to Approve</field>
252 <field name="res_model">hr.holidays</field>
253 <field name="view_type">form</field>
254 <field name="context">{'default_type': 'remove', 'search_default_approve':1}</field>
255 <field name="domain">[('type','=','remove')]</field>
256 <field name="view_id" ref="edit_holiday_new"/>
257 <field name="search_view_id" ref="view_hr_holidays_filter"/>
260 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_tree">
261 <field name="sequence" eval="1"/>
262 <field name="view_mode">tree</field>
263 <field name="view_id" ref="view_holiday"/>
264 <field name="act_window_id" ref="request_approve_holidays"/>
267 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_form">
268 <field name="sequence" eval="2"/>
269 <field name="view_mode">form</field>
270 <field name="view_id" ref="edit_holiday_new"/>
271 <field name="act_window_id" ref="request_approve_holidays"/>
274 <menuitem name="Leave Requests to Approve" parent="menu_open_ask_holidays" id="menu_request_approve_holidays" action="request_approve_holidays" groups="base.group_hr_user"/>
276 <record model="ir.actions.act_window" id="open_allocation_holidays">
277 <field name="name">Allocation Requests</field>
278 <field name="res_model">hr.holidays</field>
279 <field name="view_type">form</field>
280 <field name="context">{'default_type':'add', 'search_default_my_leaves':1}</field>
281 <field name="domain">[('type','=','add')]</field>
282 <field name="view_id" ref="edit_holiday_new"/>
283 <field name="search_view_id" ref="view_hr_holidays_filter"/>
286 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_tree">
287 <field name="sequence" eval="1"/>
288 <field name="view_mode">tree</field>
289 <field name="view_id" ref="view_holiday_allocation_tree"/>
290 <field name="act_window_id" ref="open_allocation_holidays"/>
293 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_form">
294 <field name="sequence" eval="2"/>
295 <field name="view_mode">form</field>
296 <field name="view_id" ref="edit_holiday_new"/>
297 <field name="act_window_id" ref="open_allocation_holidays"/>
300 <menuitem parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
302 <record model="ir.actions.act_window" id="request_approve_allocation">
303 <field name="name">Allocation Requests to Approve</field>
304 <field name="res_model">hr.holidays</field>
305 <field name="view_type">form</field>
306 <field name="context">{'default_type': 'add', 'search_default_approve':1}</field>
307 <field name="domain">[('type','=','add')]</field>
308 <field name="view_id" ref="edit_holiday_new"/>
309 <field name="search_view_id" ref="view_hr_holidays_filter"/>
312 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_tree">
313 <field name="sequence" eval="1"/>
314 <field name="view_mode">tree</field>
315 <field name="view_id" ref="view_holiday_allocation_tree"/>
316 <field name="act_window_id" ref="request_approve_allocation"/>
319 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_form">
320 <field name="sequence" eval="2"/>
321 <field name="view_mode">form</field>
322 <field name="view_id" ref="edit_holiday_new"/>
323 <field name="act_window_id" ref="request_approve_allocation"/>
326 <menuitem parent="menu_open_ask_holidays" id="menu_request_approve_allocation" action="request_approve_allocation" groups="base.group_hr_manager"/>
328 <record model="ir.actions.act_window" id="open_company_allocation">
329 <field name="name">Leaves Summary</field>
330 <field name="res_model">hr.holidays</field>
331 <field name="view_type">form</field>
332 <field name="view_mode">tree,form</field>
333 <field name="view_id" eval="view_holiday_simple"/>
334 <field name="context">{'search_default_group_type': 1}</field>
335 <field name="domain">[('holiday_type','=','employee'), ('state', '!=', 'refuse')]</field>
336 <field name="search_view_id" ref="view_hr_holidays_filter"/>
339 <menuitem name="Leaves Summary" parent="menu_open_ask_holidays" id="menu_open_company_allocation" action="open_company_allocation" sequence="40"/>
341 <!-- Holidays status -->
342 <record id="view_holidays_status_filter" model="ir.ui.view">
343 <field name="name">hr.holidays.status.filter</field>
344 <field name="model">hr.holidays.status</field>
345 <field name="arch" type="xml">
346 <search string="Search Leave Type">
347 <field name="name" string="Leave Types"/>
348 <field name="categ_id"/>
353 <record model="ir.ui.view" id="edit_holiday_status_form">
354 <field name="name">hr.holidays.status.form</field>
355 <field name="model">hr.holidays.status</field>
356 <field name="arch" type="xml">
357 <form string="Leave Type">
358 <sheet string="Leave Type">
361 <field name="categ_id"/>
364 <page string="Details">
366 <group name="selection" string="Validation">
367 <field name="double_validation"/>
368 <field name="limit"/>
370 <group name="second" string="Misc">
371 <field name="color_name"/>
372 <field name="active"/>
382 <record model="ir.ui.view" id="view_holiday_status_tree">
383 <field name="name">hr.holidays.status.tree</field>
384 <field name="model">hr.holidays.status</field>
385 <field name="arch" type="xml">
386 <tree string="Leave Type">
388 <field name="max_leaves"/>
389 <field name="leaves_taken"/>
390 <field name="remaining_leaves"/>
395 <record model="ir.ui.view" id="view_holiday_status_normal_tree">
396 <field name="name">hr.holidays.status.normal.tree</field>
397 <field name="model">hr.holidays.status</field>
398 <field name="priority">35</field>
399 <field name="arch" type="xml">
400 <tree string="Leave Type">
402 <field name="limit"/>
407 <record id="view_hr_holidays_status_search" model="ir.ui.view">
408 <field name="name">hr.holidays.status.search</field>
409 <field name="model">hr.holidays.status</field>
410 <field name="arch" type="xml">
411 <search string="Leave Type">
412 <field name="name" string="Leave Types"/>
413 <field name="categ_id"/>
418 <record id="open_view_holiday_status" model="ir.actions.act_window">
419 <field name="name">Leave Types</field>
420 <field name="type">ir.actions.act_window</field>
421 <field name="res_model">hr.holidays.status</field>
422 <field name="view_type">form</field>
423 <field name="view_mode">tree,form</field>
424 <field name="view_id" eval="view_holiday_status_normal_tree"/>
425 <field name="search_view_id" ref="view_hr_holidays_status_search"/>
428 <menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
429 <menuitem name="Leaves Types" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10"/>
431 <!-- Holiday on resource leave -->
432 <record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
433 <field name="name">resource.calendar.leaves.form.inherit</field>
434 <field name="model">resource.calendar.leaves</field>
435 <field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
436 <field name="arch" type="xml">
437 <field name="name" position="after">
438 <field name="holiday_id"/>
444 <record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
445 <field name="name">Leaves</field>
446 <field name="type">ir.actions.act_window</field>
447 <field name="res_model">hr.holidays</field>
448 <field name="src_model">hr.employee</field>
449 <field name="view_type">form</field>
450 <field name="view_mode">tree,form</field>
451 <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
452 <field name="domain">[('type','=','remove')]</field>
453 <field name="view_id" eval="view_holiday"/>
456 <!-- Assing leave -->
457 <record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
458 <field name="name">hr.employee.leave.tree</field>
459 <field name="model">hr.employee</field>
460 <field name="priority" eval="20"/>
461 <field name="arch" type="xml">
462 <tree string="Assign Leaves" editable="bottom">
463 <field name="name" string="Employee"/>
464 <field name="remaining_leaves" string="Remaining Legal Leaves"/>
469 <record model="ir.actions.act_window" id="hr_holidays_leaves_assign_legal">
470 <field name="name">Allocate Leaves for Employees</field>
471 <field name="type">ir.actions.act_window</field>
472 <field name="res_model">hr.employee</field>
473 <field name="view_type">form</field>
474 <field name="view_mode">tree,form</field>
475 <field name="view_id" ref="hr_holidays_leaves_assign_tree_view"/>
476 <field name="help" type="html">
478 You can assign remaining Legal Leaves for each employee, Odoo
479 will automatically create and validate allocation requests.
484 <!-- Hr employee inherit Legal Leaves -->
485 <record id="view_employee_form_leave_inherit" model="ir.ui.view">
486 <field name="name">hr.employee.leave.form.inherit</field>
487 <field name="model">hr.employee</field>
488 <field name="inherit_id" ref="hr.view_employee_form"/>
489 <field name="arch" type="xml">
490 <xpath expr="//group[@name='active_group']" position="before">
491 <group string="Leaves">
492 <label for="remaining_leaves"/>
494 <field name="remaining_leaves" class="oe_inline"/> days
498 <xpath expr="//div[@name='button_box']" position="inside">
499 <button name="%(act_hr_employee_holiday_request)d"
501 class="oe_stat_button"
503 groups="base.group_hr_user">
504 <field name="leaves_count" widget="statinfo" string="Leaves"/>
510 <record model="ir.ui.view" id="hr_kanban_view_employees_kanban">
511 <field name="name">HR - Employees Kanban with leave status</field>
512 <field name="model">hr.employee</field>
513 <field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
514 <field name="arch" type="xml">
515 <xpath expr="//templates" position="before">
516 <field name="current_leave_id"/>
517 <field name="current_leave_state"/>
518 <field name="leave_date_from"/>
519 <field name="leave_date_to"/>
521 <xpath expr="//div[@class='oe_employee_details']/ul/li[@id='last_login']" position="inside">
522 <span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
523 t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
524 t-att-title="record.leave_date_from.raw_value.toString('ddd dS MMM') + ' - ' + record.leave_date_to.raw_value.toString('ddd dS MMM')">
525 <field name="current_leave_id"/>
532 id="act_hr_leave_request_to_meeting"
533 name="Leave Meetings"
534 src_model="hr.holidays"
535 res_model="calendar.event"
536 view_mode="tree,form,calendar,gantt"