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 Requests" icon="terp-personal" name="my_leaves" domain="[('employee_id.user_id','=', uid)]" help="My Leave Requests"/>
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"
44 date_start="date_from" date_stop="date_to"
45 quick_add="True" quick_create_instance="hr_holidays.QuickCreate">
46 <field name="employee_id"/>
47 <field name="holiday_status_id"/>
52 <record id="edit_holiday_new" model="ir.ui.view">
53 <field name="name">Leave Request</field>
54 <field name="model">hr.holidays</field>
55 <field name="priority">1</field>
56 <field name="arch" type="xml">
57 <form string="Leave Request" version="7.0">
58 <field name="can_reset" invisible="1"/>
60 <button string="Confirm" name="confirm" states="draft" type="workflow" class="oe_highlight"/>
61 <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
62 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
63 <button string="Refuse" name="refuse" states="confirm,validate1,validate" type="workflow" groups="base.group_hr_user"/>
64 <button string="Reset to Draft" name="reset" type="workflow"
65 attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
66 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
68 <sheet string="Leave Request">
71 <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
72 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
73 <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."/>
76 <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"/>
77 <field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)" required="1" class="oe_inline"/>
80 <field name="number_of_days_temp" class="oe_inline"/> days
83 <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')], 'readonly':[('state','!=','draft'), ('state','!=','confirm')]}"/>
86 <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"/>
87 <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" on_change="onchange_employee(employee_id)" groups="base.group_hr_user"/>
88 <field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
92 <div class="oe_chatter">
93 <field name="message_follower_ids" widget="mail_followers"/>
94 <field name="message_ids" widget="mail_thread"/>
100 <!-- Holidays: Allocation Request -->
101 <record model="ir.ui.view" id="allocation_leave_new">
102 <field name="name">Allocation Request</field>
103 <field name="model">hr.holidays</field>
104 <field name="arch" type="xml">
105 <form string="Allocation Request" version="7.0">
106 <field name="can_reset" invisible="1"/>
108 <button string="Confirm" name="confirm" states="draft" type="workflow" class="oe_highlight"/>
109 <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
110 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
111 <button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user"/>
112 <button string="Reset to Draft" name="reset" type="workflow"
113 attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
114 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
119 <field name="name" required="1" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
120 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
121 <label for="number_of_days_temp"/>
123 <field name="number_of_days_temp" class="oe_inline"/> days
127 <field name="holiday_type" on_change="onchange_type(holiday_type)"/>
128 <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')], 'invisible':[('holiday_type','=','category')]}"/>
129 <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')]}"/>
130 <field name="department_id" attrs="{'invisible':[('holiday_type','=','category')]}"/>
133 <field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..."/>
135 <div class="oe_chatter">
136 <field name="message_follower_ids" widget="mail_followers"/>
137 <field name="message_ids" widget="mail_thread"/>
143 <record model="ir.ui.view" id="view_holiday_allocation_tree">
144 <field name="name">hr.holidays.allocation.tree</field>
145 <field name="model">hr.holidays</field>
146 <field name="arch" type="xml">
147 <tree colors="red:state == 'refuse';blue:state == 'draft';black:state in ('confirm','validate','validate1')" string="Allocation Requests">
148 <field name="employee_id"/>
149 <field name="holiday_type"/>
150 <field name="category_id"/>
151 <field name="department_id" invisible="1"/>
152 <field name="holiday_status_id"/>
154 <field name="number_of_days" string="Allocated Days" sum="Remaining Days"/>
155 <field name="manager_id" invisible="1"/>
156 <field name="user_id" invisible="1"/>
157 <field name="date_from" invisible="1"/>
158 <!--field name="type"/-->
159 <field name="state"/>
164 <!-- Holidays: Leaves Management -->
165 <record model="ir.ui.view" id="allocation_company_new">
166 <field name="name">Leaves Management</field>
167 <field name="model">hr.holidays</field>
168 <field name="arch" type="xml">
169 <form string="Leaves Management" version="7.0">
171 <button string="Submit to Manager" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
172 <button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
173 <button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
174 <button string="Reset to Draft" name="reset" states="confirm" type="workflow" groups="base.group_hr_manager"/>
175 <field name="state"/>
178 <field name="holiday_status_id"/>
180 <field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
181 <field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
182 <field name="number_of_days_temp"/>
183 <field name="manager_id"/>
185 <field name="name" placeholder="Add a reason..."/>
190 <record model="ir.ui.view" id="view_holiday_simple">
191 <field name="name">hr.holidays.report_tree</field>
192 <field name="model">hr.holidays</field>
193 <field name="priority">20</field>
194 <field name="arch" type="xml">
195 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leaves Summary">
196 <field name="employee_id"/>
197 <field name="category_id" invisible="1"/>
198 <field name="department_id" invisible="1"/>
201 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
202 <field name="date_from"/>
203 <field name="date_to"/>
204 <field name="holiday_status_id"/>
205 <field name="manager_id" invisible="1"/>
206 <field name="user_id" invisible="1"/>
207 <field name="state"/>
212 <record model="ir.ui.view" id="view_holiday">
213 <field name="name">hr.holidays.tree</field>
214 <field name="model">hr.holidays</field>
215 <field name="arch" type="xml">
216 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leave Requests">
217 <field name="employee_id"/>
218 <field name="holiday_type" string="Mode" groups="base.group_no_one"/>
219 <field name="holiday_status_id"/>
221 <field name="date_from"/>
222 <field name="date_to"/>
223 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
224 <field name="state"/>
225 <field name="category_id" invisible="1"/>
226 <field name="department_id" invisible="not context.get('set_visible',False)"/>
227 <field name="manager_id" invisible="1"/>
228 <field name="user_id" invisible="1"/>
233 <menuitem name="Leaves" parent="hr.menu_hr_root" id="menu_open_ask_holidays" sequence="20"/>
235 <record model="ir.actions.act_window" id="open_ask_holidays">
236 <field name="name">Leave Requests</field>
237 <field name="res_model">hr.holidays</field>
238 <field name="view_type">form</field>
239 <field name="view_id" ref="edit_holiday_new"/>
240 <field name="context">{'default_type': 'remove', 'search_default_my_leaves':1}</field>
241 <field name="domain">[('type','=','remove')]</field>
242 <field name="search_view_id" ref="view_hr_holidays_filter"/>
243 <field name="help" type="html">
244 <p class="oe_view_nocontent_create">
245 Click to create a new leave request.
247 Once you have recorded your leave request, it will be sent
248 to a manager for validation. Be sure to set the right leave
249 type (recuperation, legal holidays, sickness) and the exact
250 number of open days related to your leave.
255 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">
256 <field name="sequence" eval="2"/>
257 <field name="view_mode">tree</field>
258 <field name="view_id" ref="view_holiday"/>
259 <field name="act_window_id" ref="open_ask_holidays"/>
262 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_form">
263 <field name="sequence" eval="3"/>
264 <field name="view_mode">form</field>
265 <field name="view_id" ref="edit_holiday_new"/>
266 <field name="act_window_id" ref="open_ask_holidays"/>
269 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_calendar">
270 <field name="sequence" eval="1"/>
271 <field name="view_mode">calendar</field>
272 <field name="view_id" ref="view_holiday_new_calendar"/>
273 <field name="act_window_id" ref="open_ask_holidays"/>
276 <menuitem parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
278 <record model="ir.actions.act_window" id="request_approve_holidays">
279 <field name="name">Requests to Approve</field>
280 <field name="res_model">hr.holidays</field>
281 <field name="view_type">form</field>
282 <field name="context">{'default_type': 'remove', 'search_default_approve':1}</field>
283 <field name="domain">[('type','=','remove')]</field>
284 <field name="view_id" ref="edit_holiday_new"/>
285 <field name="search_view_id" ref="view_hr_holidays_filter"/>
288 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_tree">
289 <field name="sequence" eval="1"/>
290 <field name="view_mode">tree</field>
291 <field name="view_id" ref="view_holiday"/>
292 <field name="act_window_id" ref="request_approve_holidays"/>
295 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_form">
296 <field name="sequence" eval="2"/>
297 <field name="view_mode">form</field>
298 <field name="view_id" ref="edit_holiday_new"/>
299 <field name="act_window_id" ref="request_approve_holidays"/>
302 <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"/>
304 <record model="ir.actions.act_window" id="open_allocation_holidays">
305 <field name="name">Allocation Requests</field>
306 <field name="res_model">hr.holidays</field>
307 <field name="view_type">form</field>
308 <field name="context">{'default_type':'add', 'search_default_my_leaves':1}</field>
309 <field name="domain">[('type','=','add')]</field>
310 <field name="view_id" ref="allocation_leave_new"/>
311 <field name="search_view_id" ref="view_hr_holidays_filter"/>
314 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_tree">
315 <field name="sequence" eval="1"/>
316 <field name="view_mode">tree</field>
317 <field name="view_id" ref="view_holiday_allocation_tree"/>
318 <field name="act_window_id" ref="open_allocation_holidays"/>
321 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_form">
322 <field name="sequence" eval="2"/>
323 <field name="view_mode">form</field>
324 <field name="view_id" ref="allocation_leave_new"/>
325 <field name="act_window_id" ref="open_allocation_holidays"/>
328 <menuitem parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
330 <record model="ir.actions.act_window" id="request_approve_allocation">
331 <field name="name">Allocation Requests to Approve</field>
332 <field name="res_model">hr.holidays</field>
333 <field name="view_type">form</field>
334 <field name="context">{'default_type': 'add', 'search_default_approve':1}</field>
335 <field name="domain">[('type','=','add')]</field>
336 <field name="view_id" ref="allocation_leave_new"/>
337 <field name="search_view_id" ref="view_hr_holidays_filter"/>
340 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_tree">
341 <field name="sequence" eval="1"/>
342 <field name="view_mode">tree</field>
343 <field name="view_id" ref="view_holiday_allocation_tree"/>
344 <field name="act_window_id" ref="request_approve_allocation"/>
347 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_form">
348 <field name="sequence" eval="2"/>
349 <field name="view_mode">form</field>
350 <field name="view_id" ref="allocation_leave_new"/>
351 <field name="act_window_id" ref="request_approve_allocation"/>
354 <menuitem parent="menu_open_ask_holidays" id="menu_request_approve_allocation" action="request_approve_allocation" groups="base.group_hr_manager"/>
356 <record model="ir.actions.act_window" id="open_company_allocation">
357 <field name="name">Leaves Summary</field>
358 <field name="res_model">hr.holidays</field>
359 <field name="view_type">form</field>
360 <field name="view_mode">tree,form</field>
361 <field name="view_id" eval="view_holiday_simple"/>
362 <field name="context">{'search_default_group_type': 1}</field>
363 <field name="domain">[('holiday_type','=','employee'), ('state', '!=', 'refuse')]</field>
364 <field name="search_view_id" ref="view_hr_holidays_filter"/>
367 <menuitem name="Leaves Summary" parent="menu_open_ask_holidays" id="menu_open_company_allocation" action="open_company_allocation" sequence="40"/>
369 <!-- Holidays status -->
370 <record id="view_holidays_status_filter" model="ir.ui.view">
371 <field name="name">hr.holidays.status.filter</field>
372 <field name="model">hr.holidays.status</field>
373 <field name="arch" type="xml">
374 <search string="Search Leave Type">
375 <field name="name" string="Leave Types"/>
376 <field name="categ_id"/>
381 <record model="ir.ui.view" id="edit_holiday_status_form">
382 <field name="name">hr.holidays.status.form</field>
383 <field name="model">hr.holidays.status</field>
384 <field name="arch" type="xml">
385 <form string="Leave Type" version="7.0">
386 <sheet string="Leave Type">
389 <field name="categ_id"/>
392 <page string="Details">
394 <group name="selection" string="Validation">
395 <field name="double_validation"/>
396 <field name="limit"/>
398 <group name="second" string="Misc">
399 <field name="color_name"/>
400 <field name="active"/>
410 <record model="ir.ui.view" id="view_holiday_status_tree">
411 <field name="name">hr.holidays.status.tree</field>
412 <field name="model">hr.holidays.status</field>
413 <field name="arch" type="xml">
414 <tree string="Leave Type">
416 <field name="max_leaves"/>
417 <field name="leaves_taken"/>
418 <field name="remaining_leaves"/>
423 <record model="ir.ui.view" id="view_holiday_status_normal_tree">
424 <field name="name">hr.holidays.status.normal.tree</field>
425 <field name="model">hr.holidays.status</field>
426 <field name="priority">35</field>
427 <field name="arch" type="xml">
428 <tree string="Leave Type">
430 <field name="limit"/>
435 <record id="view_hr_holidays_status_search" model="ir.ui.view">
436 <field name="name">hr.holidays.status.search</field>
437 <field name="model">hr.holidays.status</field>
438 <field name="arch" type="xml">
439 <search string="Leave Type">
440 <field name="name" string="Leave Types"/>
441 <field name="categ_id"/>
446 <record id="open_view_holiday_status" model="ir.actions.act_window">
447 <field name="name">Leave Types</field>
448 <field name="type">ir.actions.act_window</field>
449 <field name="res_model">hr.holidays.status</field>
450 <field name="view_type">form</field>
451 <field name="view_mode">tree,form</field>
452 <field name="view_id" eval="view_holiday_status_normal_tree"/>
453 <field name="search_view_id" ref="view_hr_holidays_status_search"/>
456 <menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
457 <menuitem name="Leaves Types" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10"/>
459 <!-- Holiday on resource leave -->
460 <record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
461 <field name="name">resource.calendar.leaves.form.inherit</field>
462 <field name="model">resource.calendar.leaves</field>
463 <field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
464 <field name="arch" type="xml">
465 <field name="name" position="after">
466 <field name="holiday_id"/>
472 <record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
473 <field name="name">Leaves</field>
474 <field name="type">ir.actions.act_window</field>
475 <field name="res_model">hr.holidays</field>
476 <field name="src_model">hr.employee</field>
477 <field name="view_type">form</field>
478 <field name="view_mode">tree,form</field>
479 <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
480 <field name="domain">[('type','=','remove')]</field>
481 <field name="view_id" eval="view_holiday"/>
484 <!-- Assing leave -->
485 <record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
486 <field name="name">hr.employee.leave.tree</field>
487 <field name="model">hr.employee</field>
488 <field name="priority" eval="20"/>
489 <field name="arch" type="xml">
490 <tree string="Assign Leaves" editable="bottom">
491 <field name="name" string="Employee"/>
492 <field name="remaining_leaves" string="Remaining Legal Leaves"/>
497 <record model="ir.actions.act_window" id="hr_holidays_leaves_assign_legal">
498 <field name="name">Allocate Leaves for Employees</field>
499 <field name="type">ir.actions.act_window</field>
500 <field name="res_model">hr.employee</field>
501 <field name="view_type">form</field>
502 <field name="view_mode">tree,form</field>
503 <field name="view_id" ref="hr_holidays_leaves_assign_tree_view"/>
504 <field name="help" type="html">
506 You can assign remaining Legal Leaves for each employee, OpenERP
507 will automatically create and validate allocation requests.
512 <!-- Hr employee inherit Legal Leaves -->
513 <record id="view_employee_form_leave_inherit" model="ir.ui.view">
514 <field name="name">hr.employee.leave.form.inherit</field>
515 <field name="model">hr.employee</field>
516 <field name="inherit_id" ref="hr.view_employee_form"/>
517 <field name="arch" type="xml">
518 <xpath expr="//group[@name='active_group']" position="before">
519 <group string="Leaves">
520 <label for="remaining_leaves"/>
522 <field name="remaining_leaves" class="oe_inline"/> days
526 <xpath expr="//div[@name='button_box']" position="inside">
527 <button name="%(act_hr_employee_holiday_request)d" string="Leaves" type="action" groups="base.group_hr_user"/>
532 <record model="ir.ui.view" id="hr_kanban_view_employees_kanban">
533 <field name="name">HR - Employees Kanban with leave status</field>
534 <field name="model">hr.employee</field>
535 <field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
536 <field name="arch" type="xml">
537 <xpath expr="//templates" position="before">
538 <field name="current_leave_id"/>
539 <field name="current_leave_state"/>
540 <field name="leave_date_from"/>
541 <field name="leave_date_to"/>
543 <xpath expr="//div[@class='oe_employee_details']/ul/li[@id='last_login']" position="inside">
544 <span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
545 t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
546 t-att-title="record.leave_date_from.raw_value.toString('ddd dS MMM') + ' - ' + record.leave_date_to.raw_value.toString('ddd dS MMM')">
547 <field name="current_leave_id"/>
554 id="act_hr_leave_request_to_meeting"
555 name="Leave Meetings"
556 src_model="hr.holidays"
557 res_model="crm.meeting"
558 view_mode="tree,form,calendar,gantt"