4 <record id="view_hr_holidays_filter" model="ir.ui.view">
5 <field name="name">hr.holidays.filter</field>
6 <field name="model">hr.holidays</field>
7 <field name="arch" type="xml">
8 <search string="Search Leave">
11 <filter icon="terp-check" domain="[('state','=','draft')]" string="To Confirm"/>
12 <filter icon="terp-camera_test" domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="approve"/>
13 <filter icon="terp-camera_test" domain="[('state','=','validate')]" string="Validated" name="validated"/>
15 <filter icon="terp-go-year" 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)"/>
17 <filter string="My Leaves" icon="terp-personal" name="my_leaves" domain="[('employee_id.user_id','=', uid)]" help="My Leaves"/>
19 <filter string="My Department Leaves" icon="terp-personal+" help="My Department Leaves" domain="[('department_id.manager_id','=',uid)]"/>
20 <field name="employee_id"/>
21 <field name="department_id"/>
22 <field name="holiday_status_id"/>
23 <group expand="0" string="Group By...">
24 <filter name="group_name" string="Description" domain="[]" context="{'group_by':'name'}"/>
25 <filter name="group_date_from" string="Start Month" icon="terp-personal" domain="[]" context="{'group_by':'date_from'}"/>
26 <filter name="group_employee" string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
27 <filter name="group_category" string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'category_id'}"/>
28 <filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'manager_id'}"/>
29 <filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id','set_visible':True}"/>
30 <filter name="group_type" string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'holiday_status_id'}"/>
31 <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
37 <!-- Holidays: Leave Request -->
39 <record id="view_holiday_new_calendar" model="ir.ui.view">
40 <field name="name">Leave Request</field>
41 <field name="model">hr.holidays</field>
42 <field name="arch" type="xml">
43 <calendar string="Leave Request" color="employee_id" date_start="date_from" date_stop="date_to">
44 <field name="employee_id"/>
45 <field name="holiday_status_id"/>
50 <record id="edit_holiday_new" model="ir.ui.view">
51 <field name="name">Leave Request</field>
52 <field name="model">hr.holidays</field>
53 <field name="priority">1</field>
54 <field name="arch" type="xml">
55 <form string="Leave Request" version="7.0">
56 <field name="can_reset" invisible="1"/>
58 <button string="Confirm" name="confirm" states="draft" type="workflow" class="oe_highlight"/>
59 <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
60 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
61 <button string="Refuse" name="refuse" states="confirm,validate1,validate" type="workflow" groups="base.group_hr_user"/>
62 <button string="Reset to Draft" name="reset" type="workflow"
63 attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
64 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
66 <sheet string="Leave Request">
69 <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
70 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
71 <label for="number_of_days_temp" string="Duration" help="The default duration interval between the start date and the end date is 8 hours. Feel free to adapt it to your needs."/>
74 <field name="date_from" nolabel="1" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/><label string="-" class="oe_inline"/>
75 <field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)" required="1" class="oe_inline"/>
78 <field name="number_of_days_temp" class="oe_inline"/> days
81 <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')], 'readonly':[('state','!=','draft'), ('state','!=','confirm')]}"/>
84 <field name="holiday_type" on_change="onchange_type(holiday_type, employee_id)" attrs="{'readonly':[('state','!=','draft')]}" width="130" string="Mode" groups="base.group_hr_user"/>
85 <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" on_change="onchange_employee(employee_id)" groups="base.group_hr_user"/>
86 <field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
90 <div class="oe_chatter">
91 <field name="message_follower_ids" widget="mail_followers"/>
92 <field name="message_ids" widget="mail_thread"/>
98 <!-- Holidays: Allocation Request -->
99 <record model="ir.ui.view" id="allocation_leave_new">
100 <field name="name">Allocation Request</field>
101 <field name="model">hr.holidays</field>
102 <field name="arch" type="xml">
103 <form string="Allocation Request" version="7.0">
104 <field name="can_reset" invisible="1"/>
106 <button string="Confirm" name="confirm" states="draft" type="workflow" class="oe_highlight"/>
107 <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
108 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
109 <button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user"/>
110 <button string="Reset to Draft" name="reset" type="workflow"
111 attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
112 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
117 <field name="name" required="1" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
118 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
119 <label for="number_of_days_temp"/>
121 <field name="number_of_days_temp" class="oe_inline"/> days
125 <field name="holiday_type" on_change="onchange_type(holiday_type)"/>
126 <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')], 'invisible':[('holiday_type','=','category')]}"/>
127 <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')]}"/>
128 <field name="department_id" attrs="{'invisible':[('holiday_type','=','category')]}"/>
131 <field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..."/>
133 <div class="oe_chatter">
134 <field name="message_follower_ids" widget="mail_followers"/>
135 <field name="message_ids" widget="mail_thread"/>
141 <record model="ir.ui.view" id="view_holiday_allocation_tree">
142 <field name="name">hr.holidays.allocation.tree</field>
143 <field name="model">hr.holidays</field>
144 <field name="arch" type="xml">
145 <tree colors="red:state == 'refuse';blue:state == 'draft';black:state in ('confirm','validate','validate1')" string="Allocation Requests">
146 <field name="employee_id"/>
147 <field name="holiday_type"/>
148 <field name="category_id"/>
149 <field name="department_id" invisible="1"/>
150 <field name="holiday_status_id"/>
152 <field name="number_of_days" string="Allocated Days" sum="Remaining Days"/>
153 <field name="manager_id" invisible="1"/>
154 <field name="user_id" invisible="1"/>
155 <field name="date_from" invisible="1"/>
156 <!--field name="type"/-->
157 <field name="state"/>
162 <!-- Holidays: Leaves Management -->
163 <record model="ir.ui.view" id="allocation_company_new">
164 <field name="name">Leaves Management</field>
165 <field name="model">hr.holidays</field>
166 <field name="arch" type="xml">
167 <form string="Leaves Management" version="7.0">
169 <button string="Submit to Manager" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
170 <button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
171 <button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
172 <button string="Reset to Draft" name="reset" states="confirm" type="workflow" groups="base.group_hr_manager"/>
173 <field name="state"/>
176 <field name="holiday_status_id"/>
178 <field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
179 <field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
180 <field name="number_of_days_temp"/>
181 <field name="manager_id"/>
183 <field name="name" placeholder="Add a reason..."/>
188 <record model="ir.ui.view" id="view_holiday_simple">
189 <field name="name">hr.holidays.report_tree</field>
190 <field name="model">hr.holidays</field>
191 <field name="priority">20</field>
192 <field name="arch" type="xml">
193 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leaves Summary">
194 <field name="employee_id"/>
195 <field name="category_id" invisible="1"/>
196 <field name="department_id" invisible="1"/>
199 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
200 <field name="date_from"/>
201 <field name="date_to"/>
202 <field name="holiday_status_id"/>
203 <field name="manager_id" invisible="1"/>
204 <field name="user_id" invisible="1"/>
205 <field name="state"/>
210 <record model="ir.ui.view" id="view_holiday">
211 <field name="name">hr.holidays.tree</field>
212 <field name="model">hr.holidays</field>
213 <field name="arch" type="xml">
214 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leave Requests">
215 <field name="employee_id"/>
216 <field name="holiday_type" string="Mode" groups="base.group_no_one"/>
217 <field name="holiday_status_id"/>
219 <field name="date_from"/>
220 <field name="date_to"/>
221 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
222 <field name="state"/>
223 <field name="category_id" invisible="1"/>
224 <field name="department_id" invisible="not context.get('set_visible',False)"/>
225 <field name="manager_id" invisible="1"/>
226 <field name="user_id" invisible="1"/>
231 <menuitem name="Leaves" parent="hr.menu_hr_root" id="menu_open_ask_holidays" sequence="20"/>
233 <record model="ir.actions.act_window" id="open_ask_holidays">
234 <field name="name">Leave Requests</field>
235 <field name="res_model">hr.holidays</field>
236 <field name="view_type">form</field>
237 <field name="view_id" ref="edit_holiday_new"/>
238 <field name="context">{'default_type': 'remove', 'search_default_my_leaves':1}</field>
239 <field name="domain">[('type','=','remove')]</field>
240 <field name="search_view_id" ref="view_hr_holidays_filter"/>
241 <field name="help" type="html">
242 <p class="oe_view_nocontent_create">
243 Click to create a new leave request.
245 Once you have recorded your leave request, it will be sent
246 to a manager for validation. Be sure to set the right leave
247 type (recuperation, legal holidays, sickness) and the exact
248 number of open days related to your leave.
253 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">
254 <field name="sequence" eval="2"/>
255 <field name="view_mode">tree</field>
256 <field name="view_id" ref="view_holiday"/>
257 <field name="act_window_id" ref="open_ask_holidays"/>
260 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_form">
261 <field name="sequence" eval="3"/>
262 <field name="view_mode">form</field>
263 <field name="view_id" ref="edit_holiday_new"/>
264 <field name="act_window_id" ref="open_ask_holidays"/>
267 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_calendar">
268 <field name="sequence" eval="1"/>
269 <field name="view_mode">calendar</field>
270 <field name="view_id" ref="view_holiday_new_calendar"/>
271 <field name="act_window_id" ref="open_ask_holidays"/>
274 <menuitem parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
276 <record model="ir.actions.act_window" id="request_approve_holidays">
277 <field name="name">Requests to Approve</field>
278 <field name="res_model">hr.holidays</field>
279 <field name="view_type">form</field>
280 <field name="context">{'default_type': 'remove', 'search_default_approve':1}</field>
281 <field name="domain">[('type','=','remove')]</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_request_approve_holidays_tree">
287 <field name="sequence" eval="1"/>
288 <field name="view_mode">tree</field>
289 <field name="view_id" ref="view_holiday"/>
290 <field name="act_window_id" ref="request_approve_holidays"/>
293 <record model="ir.actions.act_window.view" id="action_request_approve_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="request_approve_holidays"/>
300 <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"/>
302 <record model="ir.actions.act_window" id="open_allocation_holidays">
303 <field name="name">Allocation Requests</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_my_leaves':1}</field>
307 <field name="domain">[('type','=','add')]</field>
308 <field name="view_id" ref="allocation_leave_new"/>
309 <field name="search_view_id" ref="view_hr_holidays_filter"/>
312 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_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="open_allocation_holidays"/>
319 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_form">
320 <field name="sequence" eval="2"/>
321 <field name="view_mode">form</field>
322 <field name="view_id" ref="allocation_leave_new"/>
323 <field name="act_window_id" ref="open_allocation_holidays"/>
326 <menuitem parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
328 <record model="ir.actions.act_window" id="request_approve_allocation">
329 <field name="name">Allocation Requests to Approve</field>
330 <field name="res_model">hr.holidays</field>
331 <field name="view_type">form</field>
332 <field name="context">{'default_type': 'add', 'search_default_approve':1}</field>
333 <field name="domain">[('type','=','add')]</field>
334 <field name="view_id" ref="allocation_leave_new"/>
335 <field name="search_view_id" ref="view_hr_holidays_filter"/>
338 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_tree">
339 <field name="sequence" eval="1"/>
340 <field name="view_mode">tree</field>
341 <field name="view_id" ref="view_holiday_allocation_tree"/>
342 <field name="act_window_id" ref="request_approve_allocation"/>
345 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_form">
346 <field name="sequence" eval="2"/>
347 <field name="view_mode">form</field>
348 <field name="view_id" ref="allocation_leave_new"/>
349 <field name="act_window_id" ref="request_approve_allocation"/>
352 <menuitem parent="menu_open_ask_holidays" id="menu_request_approve_allocation" action="request_approve_allocation" groups="base.group_hr_manager"/>
354 <record model="ir.actions.act_window" id="open_company_allocation">
355 <field name="name">Leaves Summary</field>
356 <field name="res_model">hr.holidays</field>
357 <field name="view_type">form</field>
358 <field name="view_mode">tree,form</field>
359 <field name="view_id" eval="view_holiday_simple"/>
360 <field name="context">{'search_default_group_type': 1}</field>
361 <field name="domain">[('holiday_type','=','employee'), ('state', '!=', 'refuse')]</field>
362 <field name="search_view_id" ref="view_hr_holidays_filter"/>
365 <menuitem name="Leaves Summary" parent="menu_open_ask_holidays" id="menu_open_company_allocation" action="open_company_allocation" sequence="40"/>
367 <!-- Holidays status -->
368 <record id="view_holidays_status_filter" model="ir.ui.view">
369 <field name="name">hr.holidays.status.filter</field>
370 <field name="model">hr.holidays.status</field>
371 <field name="arch" type="xml">
372 <search string="Search Leave Type">
373 <field name="name" string="Leave Types"/>
374 <field name="categ_id"/>
379 <record model="ir.ui.view" id="edit_holiday_status_form">
380 <field name="name">hr.holidays.status.form</field>
381 <field name="model">hr.holidays.status</field>
382 <field name="arch" type="xml">
383 <form string="Leave Type" version="7.0">
384 <sheet string="Leave Type">
387 <field name="categ_id"/>
390 <page string="Details">
392 <group name="selection" string="Validation">
393 <field name="double_validation"/>
394 <field name="limit"/>
396 <group name="second" string="Misc">
397 <field name="color_name"/>
398 <field name="active"/>
408 <record model="ir.ui.view" id="view_holiday_status_tree">
409 <field name="name">hr.holidays.status.tree</field>
410 <field name="model">hr.holidays.status</field>
411 <field name="arch" type="xml">
412 <tree string="Leave Type">
414 <field name="max_leaves"/>
415 <field name="leaves_taken"/>
416 <field name="remaining_leaves"/>
421 <record model="ir.ui.view" id="view_holiday_status_normal_tree">
422 <field name="name">hr.holidays.status.normal.tree</field>
423 <field name="model">hr.holidays.status</field>
424 <field name="priority">35</field>
425 <field name="arch" type="xml">
426 <tree string="Leave Type">
428 <field name="limit"/>
433 <record id="view_hr_holidays_status_search" model="ir.ui.view">
434 <field name="name">hr.holidays.status.search</field>
435 <field name="model">hr.holidays.status</field>
436 <field name="arch" type="xml">
437 <search string="Leave Type">
438 <field name="name" string="Leave Types"/>
439 <field name="categ_id"/>
444 <record id="open_view_holiday_status" model="ir.actions.act_window">
445 <field name="name">Leave Types</field>
446 <field name="type">ir.actions.act_window</field>
447 <field name="res_model">hr.holidays.status</field>
448 <field name="view_type">form</field>
449 <field name="view_mode">tree,form</field>
450 <field name="view_id" eval="view_holiday_status_normal_tree"/>
451 <field name="search_view_id" ref="view_hr_holidays_status_search"/>
454 <menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
455 <menuitem name="Leaves Types" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10"/>
457 <!-- Holiday on resource leave -->
458 <record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
459 <field name="name">resource.calendar.leaves.form.inherit</field>
460 <field name="model">resource.calendar.leaves</field>
461 <field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
462 <field name="arch" type="xml">
463 <field name="name" position="after">
464 <field name="holiday_id"/>
470 <record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
471 <field name="name">Leaves</field>
472 <field name="type">ir.actions.act_window</field>
473 <field name="res_model">hr.holidays</field>
474 <field name="src_model">hr.employee</field>
475 <field name="view_type">form</field>
476 <field name="view_mode">tree,form</field>
477 <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
478 <field name="domain">[('type','=','remove')]</field>
479 <field name="view_id" eval="view_holiday"/>
482 <!-- Assing leave -->
483 <record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
484 <field name="name">hr.employee.leave.tree</field>
485 <field name="model">hr.employee</field>
486 <field name="priority" eval="20"/>
487 <field name="arch" type="xml">
488 <tree string="Assign Leaves" editable="bottom">
489 <field name="name" string="Employee"/>
490 <field name="remaining_leaves" string="Remaining Legal Leaves"/>
495 <record model="ir.actions.act_window" id="hr_holidays_leaves_assign_legal">
496 <field name="name">Allocate Leaves for Employees</field>
497 <field name="type">ir.actions.act_window</field>
498 <field name="res_model">hr.employee</field>
499 <field name="view_type">form</field>
500 <field name="view_mode">tree,form</field>
501 <field name="view_id" ref="hr_holidays_leaves_assign_tree_view"/>
502 <field name="help" type="html">
504 You can assign remaining Legal Leaves for each employee, OpenERP
505 will automatically create and validate allocation requests.
510 <!-- Hr employee inherit Legal Leaves -->
511 <record id="view_employee_form_leave_inherit" model="ir.ui.view">
512 <field name="name">hr.employee.leave.form.inherit</field>
513 <field name="model">hr.employee</field>
514 <field name="inherit_id" ref="hr.view_employee_form"/>
515 <field name="arch" type="xml">
516 <xpath expr="//group[@name='active_group']" position="before">
517 <group string="Leaves">
518 <label for="remaining_leaves"/>
520 <field name="remaining_leaves" class="oe_inline"/> days
524 <xpath expr="//div[@name='button_box']" position="inside">
525 <button name="%(act_hr_employee_holiday_request)d" string="Leaves" type="action" groups="base.group_hr_user"/>
530 <record model="ir.ui.view" id="hr_kanban_view_employees_kanban">
531 <field name="name">HR - Employees Kanban with leave status</field>
532 <field name="model">hr.employee</field>
533 <field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
534 <field name="arch" type="xml">
535 <xpath expr="//templates" position="before">
536 <field name="current_leave_id"/>
537 <field name="current_leave_state"/>
538 <field name="leave_date_from"/>
539 <field name="leave_date_to"/>
541 <xpath expr="//div[@class='oe_employee_details']/ul/li[@id='last_login']" position="inside">
542 <span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
543 t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
544 t-att-title="record.leave_date_from.raw_value.toString('ddd dS MMM') + ' - ' + record.leave_date_to.raw_value.toString('ddd dS MMM')">
545 <field name="current_leave_id"/>
552 id="act_hr_leave_request_to_meeting"
553 name="Leave Meetings"
554 src_model="hr.holidays"
555 res_model="crm.meeting"
556 view_mode="tree,form,calendar,gantt"