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 Date" 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">
57 <button string="Confirm" name="confirm" states="draft" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
58 <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
59 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
60 <button string="Refuse" name="refuse" states="confirm,validate1,validate" type="workflow" groups="base.group_hr_user"/>
61 <button string="Reset to Draft" name="reset" states="confirm" type="workflow" groups="base.group_hr_manager"/>
62 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
64 <sheet string="Leave Request">
67 <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
68 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
69 <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."/>
72 <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"/>
73 <field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)" required="1" class="oe_inline"/>
76 <field name="number_of_days_temp" class="oe_inline"/> days
79 <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')], 'readonly':[('state','!=','draft'), ('state','!=','confirm')]}"/>
82 <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"/>
83 <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" on_change="onchange_employee(employee_id)" groups="base.group_hr_user"/>
84 <field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
88 <div class="oe_chatter">
89 <field name="message_follower_ids" widget="mail_followers"/>
90 <field name="message_ids" widget="mail_thread"/>
96 <!-- Holidays: Allocation Request -->
97 <record model="ir.ui.view" id="allocation_leave_new">
98 <field name="name">Allocation Request</field>
99 <field name="model">hr.holidays</field>
100 <field name="arch" type="xml">
101 <form string="Allocation Request" version="7.0">
103 <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
104 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
105 <button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user"/>
106 <button string="Reset to Draft" name="reset" states="confirm" type="workflow" groups="base.group_hr_manager"/>
107 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
112 <field name="name" required="1" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
113 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
114 <label for="number_of_days_temp"/>
116 <field name="number_of_days_temp" class="oe_inline"/> days
120 <field name="holiday_type" on_change="onchange_type(holiday_type)"/>
121 <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')], 'invisible':[('holiday_type','=','category')]}"/>
122 <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')]}"/>
123 <field name="department_id" attrs="{'invisible':[('holiday_type','=','category')]}"/>
126 <field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..."/>
128 <div class="oe_chatter">
129 <field name="message_follower_ids" widget="mail_followers"/>
130 <field name="message_ids" widget="mail_thread"/>
136 <record model="ir.ui.view" id="view_holiday_allocation_tree">
137 <field name="name">hr.holidays.allocation.tree</field>
138 <field name="model">hr.holidays</field>
139 <field name="arch" type="xml">
140 <tree colors="red:state == 'refuse';blue:state == 'draft';black:state in ('confirm','validate','validate1')" string="Allocation Requests">
141 <field name="employee_id"/>
142 <field name="holiday_type"/>
143 <field name="category_id"/>
144 <field name="department_id" invisible="1"/>
145 <field name="holiday_status_id"/>
147 <field name="number_of_days" string="Allocated Days" sum="Remaining Days"/>
148 <field name="manager_id" invisible="1"/>
149 <field name="user_id" invisible="1"/>
150 <field name="date_from" invisible="1"/>
151 <!--field name="type"/-->
152 <field name="state"/>
157 <!-- Holidays: Leaves Management -->
158 <record model="ir.ui.view" id="allocation_company_new">
159 <field name="name">Leaves Management</field>
160 <field name="model">hr.holidays</field>
161 <field name="arch" type="xml">
162 <form string="Leaves Management" version="7.0">
164 <button string="Submit to Manager" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
165 <button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
166 <button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
167 <button string="Reset to Draft" name="reset" states="confirm" type="workflow" groups="base.group_hr_manager"/>
168 <field name="state"/>
171 <field name="holiday_status_id"/>
173 <field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
174 <field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
175 <field name="number_of_days_temp"/>
176 <field name="manager_id"/>
178 <field name="name" placeholder="Add a reason..."/>
183 <record model="ir.ui.view" id="view_holiday_simple">
184 <field name="name">hr.holidays.report_tree</field>
185 <field name="model">hr.holidays</field>
186 <field name="priority">20</field>
187 <field name="arch" type="xml">
188 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leaves Summary">
189 <field name="employee_id"/>
190 <field name="category_id" invisible="1"/>
191 <field name="department_id" invisible="1"/>
194 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
195 <field name="date_from"/>
196 <field name="date_to"/>
197 <field name="holiday_status_id"/>
198 <field name="manager_id" invisible="1"/>
199 <field name="user_id" invisible="1"/>
200 <field name="state"/>
205 <record model="ir.ui.view" id="view_holiday">
206 <field name="name">hr.holidays.tree</field>
207 <field name="model">hr.holidays</field>
208 <field name="arch" type="xml">
209 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leave Requests">
210 <field name="employee_id"/>
211 <field name="holiday_type" string="Mode" groups="base.group_no_one"/>
212 <field name="holiday_status_id"/>
214 <field name="date_from"/>
215 <field name="date_to"/>
216 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
217 <field name="state"/>
218 <field name="category_id" invisible="1"/>
219 <field name="department_id" invisible="not context.get('set_visible',False)"/>
220 <field name="manager_id" invisible="1"/>
221 <field name="user_id" invisible="1"/>
226 <menuitem name="Leaves" parent="hr.menu_hr_root" id="menu_open_ask_holidays" sequence="20"/>
228 <record model="ir.actions.act_window" id="open_ask_holidays">
229 <field name="name">Leave Requests</field>
230 <field name="res_model">hr.holidays</field>
231 <field name="view_type">form</field>
232 <field name="view_id" ref="edit_holiday_new"/>
233 <field name="context">{'default_type': 'remove', 'search_default_my_leaves':1}</field>
234 <field name="domain">[('type','=','remove')]</field>
235 <field name="search_view_id" ref="view_hr_holidays_filter"/>
236 <field name="help" type="html">
237 <p class="oe_view_nocontent_create">
238 Click to create a new leave request.
240 Once you have recorded your leave request, it will be sent
241 to a manager for validation. Be sure to set the right leave
242 type (recuperation, legal holidays, sickness) and the exact
243 number of open days related to your leave.
248 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">
249 <field name="sequence" eval="2"/>
250 <field name="view_mode">tree</field>
251 <field name="view_id" ref="view_holiday"/>
252 <field name="act_window_id" ref="open_ask_holidays"/>
255 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_form">
256 <field name="sequence" eval="3"/>
257 <field name="view_mode">form</field>
258 <field name="view_id" ref="edit_holiday_new"/>
259 <field name="act_window_id" ref="open_ask_holidays"/>
262 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_calendar">
263 <field name="sequence" eval="1"/>
264 <field name="view_mode">calendar</field>
265 <field name="view_id" ref="view_holiday_new_calendar"/>
266 <field name="act_window_id" ref="open_ask_holidays"/>
269 <menuitem parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
271 <record model="ir.actions.act_window" id="request_approve_holidays">
272 <field name="name">Requests to Approve</field>
273 <field name="res_model">hr.holidays</field>
274 <field name="view_type">form</field>
275 <field name="context">{'default_type': 'remove', 'search_default_approve':1}</field>
276 <field name="domain">[('type','=','remove')]</field>
277 <field name="view_id" ref="edit_holiday_new"/>
278 <field name="search_view_id" ref="view_hr_holidays_filter"/>
281 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_tree">
282 <field name="sequence" eval="1"/>
283 <field name="view_mode">tree</field>
284 <field name="view_id" ref="view_holiday"/>
285 <field name="act_window_id" ref="request_approve_holidays"/>
288 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_form">
289 <field name="sequence" eval="2"/>
290 <field name="view_mode">form</field>
291 <field name="view_id" ref="edit_holiday_new"/>
292 <field name="act_window_id" ref="request_approve_holidays"/>
295 <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"/>
297 <record model="ir.actions.act_window" id="open_allocation_holidays">
298 <field name="name">Allocation Requests</field>
299 <field name="res_model">hr.holidays</field>
300 <field name="view_type">form</field>
301 <field name="context">{'default_type':'add', 'search_default_my_leaves':1}</field>
302 <field name="domain">[('type','=','add')]</field>
303 <field name="view_id" ref="allocation_leave_new"/>
304 <field name="search_view_id" ref="view_hr_holidays_filter"/>
307 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_tree">
308 <field name="sequence" eval="1"/>
309 <field name="view_mode">tree</field>
310 <field name="view_id" ref="view_holiday_allocation_tree"/>
311 <field name="act_window_id" ref="open_allocation_holidays"/>
314 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_form">
315 <field name="sequence" eval="2"/>
316 <field name="view_mode">form</field>
317 <field name="view_id" ref="allocation_leave_new"/>
318 <field name="act_window_id" ref="open_allocation_holidays"/>
321 <menuitem parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
323 <record model="ir.actions.act_window" id="request_approve_allocation">
324 <field name="name">Allocation Requests to Approve</field>
325 <field name="res_model">hr.holidays</field>
326 <field name="view_type">form</field>
327 <field name="context">{'default_type': 'add', 'search_default_approve':1}</field>
328 <field name="domain">[('type','=','add')]</field>
329 <field name="view_id" ref="allocation_leave_new"/>
330 <field name="search_view_id" ref="view_hr_holidays_filter"/>
333 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_tree">
334 <field name="sequence" eval="1"/>
335 <field name="view_mode">tree</field>
336 <field name="view_id" ref="view_holiday_allocation_tree"/>
337 <field name="act_window_id" ref="request_approve_allocation"/>
340 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_form">
341 <field name="sequence" eval="2"/>
342 <field name="view_mode">form</field>
343 <field name="view_id" ref="allocation_leave_new"/>
344 <field name="act_window_id" ref="request_approve_allocation"/>
347 <menuitem parent="menu_open_ask_holidays" id="menu_request_approve_allocation" action="request_approve_allocation" groups="base.group_hr_manager"/>
349 <record model="ir.actions.act_window" id="open_company_allocation">
350 <field name="name">Leaves Summary</field>
351 <field name="res_model">hr.holidays</field>
352 <field name="view_type">form</field>
353 <field name="view_mode">tree,form</field>
354 <field name="view_id" eval="view_holiday_simple"/>
355 <field name="context">{'search_default_group_type': 1, 'search_default_validated': 1}</field>
356 <field name="domain">[('holiday_type','=','employee')]</field>
357 <field name="search_view_id" ref="view_hr_holidays_filter"/>
360 <menuitem name="Leaves Summary" parent="menu_open_ask_holidays" id="menu_open_company_allocation" action="open_company_allocation" sequence="40"/>
362 <!-- Holidays status -->
363 <record id="view_holidays_status_filter" model="ir.ui.view">
364 <field name="name">hr.holidays.status.filter</field>
365 <field name="model">hr.holidays.status</field>
366 <field name="arch" type="xml">
367 <search string="Search Leave Type">
368 <field name="name" string="Leave Types"/>
369 <field name="categ_id"/>
374 <record model="ir.ui.view" id="edit_holiday_status_form">
375 <field name="name">hr.holidays.status.form</field>
376 <field name="model">hr.holidays.status</field>
377 <field name="arch" type="xml">
378 <form string="Leave Type" version="7.0">
379 <sheet string="Leave Type">
382 <field name="categ_id"/>
385 <page string="Details">
387 <group name="selection" string="Validation">
388 <field name="double_validation"/>
389 <field name="limit"/>
391 <group name="second" string="Misc">
392 <field name="color_name"/>
393 <field name="active"/>
403 <record model="ir.ui.view" id="view_holiday_status_tree">
404 <field name="name">hr.holidays.status.tree</field>
405 <field name="model">hr.holidays.status</field>
406 <field name="arch" type="xml">
407 <tree string="Leave Type">
409 <field name="max_leaves"/>
410 <field name="leaves_taken"/>
411 <field name="remaining_leaves"/>
416 <record model="ir.ui.view" id="view_holiday_status_normal_tree">
417 <field name="name">hr.holidays.status.normal.tree</field>
418 <field name="model">hr.holidays.status</field>
419 <field name="priority">35</field>
420 <field name="arch" type="xml">
421 <tree string="Leave Type">
423 <field name="limit"/>
428 <record id="view_hr_holidays_status_search" model="ir.ui.view">
429 <field name="name">hr.holidays.status.search</field>
430 <field name="model">hr.holidays.status</field>
431 <field name="arch" type="xml">
432 <search string="Leave Type">
433 <field name="name" string="Leave Types"/>
434 <field name="categ_id"/>
439 <record id="open_view_holiday_status" model="ir.actions.act_window">
440 <field name="name">Leave Types</field>
441 <field name="type">ir.actions.act_window</field>
442 <field name="res_model">hr.holidays.status</field>
443 <field name="view_type">form</field>
444 <field name="view_mode">tree,form</field>
445 <field name="view_id" eval="view_holiday_status_normal_tree"/>
446 <field name="search_view_id" ref="view_hr_holidays_status_search"/>
449 <menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
450 <menuitem name="Leaves Types" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10"/>
452 <!-- Holiday on resource leave -->
453 <record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
454 <field name="name">resource.calendar.leaves.form.inherit</field>
455 <field name="model">resource.calendar.leaves</field>
456 <field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
457 <field name="arch" type="xml">
458 <field name="name" position="after">
459 <field name="holiday_id"/>
465 <record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
466 <field name="name">Leaves</field>
467 <field name="type">ir.actions.act_window</field>
468 <field name="res_model">hr.holidays</field>
469 <field name="src_model">hr.employee</field>
470 <field name="view_type">form</field>
471 <field name="view_mode">tree,form</field>
472 <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
473 <field name="domain">[('type','=','remove')]</field>
474 <field name="view_id" eval="view_holiday"/>
477 <!-- Assing leave -->
478 <record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
479 <field name="name">hr.employee.leave.tree</field>
480 <field name="model">hr.employee</field>
481 <field name="priority" eval="20"/>
482 <field name="arch" type="xml">
483 <tree string="Assign Leaves" editable="bottom">
484 <field name="name" string="Employee"/>
485 <field name="remaining_leaves" string="Remaining Legal Leaves"/>
490 <record model="ir.actions.act_window" id="hr_holidays_leaves_assign_legal">
491 <field name="name">Allocate Leaves for Employees</field>
492 <field name="type">ir.actions.act_window</field>
493 <field name="res_model">hr.employee</field>
494 <field name="view_type">form</field>
495 <field name="view_mode">tree,form</field>
496 <field name="view_id" ref="hr_holidays_leaves_assign_tree_view"/>
497 <field name="help" type="html">
499 You can assign remaining Legal Leaves for each employee, OpenERP
500 will automatically create and validate allocation requests.
505 <!-- Hr employee inherit Legal Leaves -->
506 <record id="view_employee_form_leave_inherit" model="ir.ui.view">
507 <field name="name">hr.employee.leave.form.inherit</field>
508 <field name="model">hr.employee</field>
509 <field name="inherit_id" ref="hr.view_employee_form"/>
510 <field name="arch" type="xml">
511 <xpath expr="//group[@name='active_group']" position="before">
512 <group string="Leaves">
513 <label for="remaining_leaves"/>
515 <field name="remaining_leaves" class="oe_inline"/> days
519 <xpath expr="//div[@name='button_box']" position="inside">
520 <button name="%(act_hr_employee_holiday_request)d" string="Leaves" type="action" groups="base.group_hr_user"/>
525 <record model="ir.ui.view" id="hr_kanban_view_employees_kanban">
526 <field name="name">HR - Employees Kanban with leave status</field>
527 <field name="model">hr.employee</field>
528 <field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
529 <field name="arch" type="xml">
530 <xpath expr="//templates" position="before">
531 <field name="current_leave_id"/>
532 <field name="current_leave_state"/>
533 <field name="leave_date_from"/>
534 <field name="leave_date_to"/>
536 <xpath expr="//div[@class='oe_employee_details']/ul/li[@id='last_login']" position="inside">
537 <span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
538 t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
539 t-att-title="record.leave_date_from.raw_value.toString('ddd dS MMM') + ' - ' + record.leave_date_to.raw_value.toString('ddd dS MMM')">
540 <field name="current_leave_id"/>
547 id="act_hr_leave_request_to_meeting"
548 name="Leave Meetings"
549 src_model="hr.holidays"
550 res_model="crm.meeting"
551 view_mode="tree,form,calendar,gantt"