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="False" avatar_model="hr.employee">
46 <field name="employee_id"/>
47 <field name="holiday_status_id"/>
52 <!-- Holidays: Allocation Request -->
53 <record model="ir.ui.view" id="edit_holiday_new">
54 <field name="name">Leave Request</field>
55 <field name="model">hr.holidays</field>
56 <field name="arch" type="xml">
57 <form string="Leave Request">
58 <field name="can_reset" invisible="1"/>
59 <field name="type" invisible="1"/>
61 <button string="Confirm" name="confirm" states="draft" type="workflow" class="oe_highlight"/>
62 <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
63 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
64 <button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user"/>
65 <button string="Reset to Draft" name="reset" type="workflow"
66 attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
67 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
72 <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')], 'required': [('type', '=', 'add')]}"/>
73 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
74 <label for="number_of_days_temp" string="Duration"/>
76 <group col="3" attrs="{'invisible': [('type', '=', 'add')]}">
77 <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"/>
78 <field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)" attrs="{'required':[('type', '=', 'remove')]}" class="oe_inline"/>
81 <field name="number_of_days_temp" class="oe_inline"/> days
86 <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}" />
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="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly': [('type', '=', 'remove'),('state','!=','draft'), ('state','!=','confirm')], 'invisible':[('holiday_type','=','employee')]}"/>
89 <field name="department_id" attrs="{'readonly':['|', ('type','=','add'),('holiday_type','=','category')],'invisible':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
92 <field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..." attrs="{'invisible': [('type', '=', 'remove')]}"/>
94 <div class="oe_chatter">
95 <field name="message_follower_ids" widget="mail_followers"/>
96 <field name="message_ids" widget="mail_thread"/>
102 <record model="ir.ui.view" id="view_holiday_allocation_tree">
103 <field name="name">hr.holidays.allocation.tree</field>
104 <field name="model">hr.holidays</field>
105 <field name="arch" type="xml">
106 <tree colors="red:state == 'refuse';blue:state == 'draft';black:state in ('confirm','validate','validate1')" string="Allocation Requests">
107 <field name="employee_id"/>
108 <field name="holiday_type"/>
109 <field name="category_id"/>
110 <field name="department_id" invisible="1"/>
111 <field name="holiday_status_id"/>
113 <field name="number_of_days" string="Allocated Days" sum="Remaining Days"/>
114 <field name="manager_id" invisible="1"/>
115 <field name="user_id" invisible="1"/>
116 <field name="date_from" invisible="1"/>
117 <!--field name="type"/-->
118 <field name="state"/>
123 <!-- Holidays: Leaves Management -->
124 <record model="ir.ui.view" id="allocation_company_new">
125 <field name="name">Leaves Management</field>
126 <field name="model">hr.holidays</field>
127 <field name="arch" type="xml">
128 <form string="Leaves Management">
130 <button string="Submit to Manager" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
131 <button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
132 <button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
133 <button string="Reset to Draft" name="reset" states="confirm" type="workflow" groups="base.group_hr_manager"/>
134 <field name="state"/>
137 <field name="holiday_status_id"/>
139 <field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
140 <field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
141 <field name="number_of_days_temp"/>
142 <field name="manager_id"/>
144 <field name="name" placeholder="Add a reason..."/>
149 <record model="ir.ui.view" id="view_holiday_simple">
150 <field name="name">hr.holidays.report_tree</field>
151 <field name="model">hr.holidays</field>
152 <field name="priority">20</field>
153 <field name="arch" type="xml">
154 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leaves Summary">
155 <field name="employee_id"/>
156 <field name="category_id" invisible="1"/>
157 <field name="department_id" invisible="1"/>
160 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
161 <field name="date_from"/>
162 <field name="date_to"/>
163 <field name="holiday_status_id"/>
164 <field name="manager_id" invisible="1"/>
165 <field name="user_id" invisible="1"/>
166 <field name="state"/>
171 <record model="ir.ui.view" id="view_holiday">
172 <field name="name">hr.holidays.tree</field>
173 <field name="model">hr.holidays</field>
174 <field name="arch" type="xml">
175 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leave Requests">
176 <field name="employee_id"/>
177 <field name="holiday_type" string="Mode" groups="base.group_no_one"/>
178 <field name="holiday_status_id"/>
180 <field name="date_from"/>
181 <field name="date_to"/>
182 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
183 <field name="state"/>
184 <field name="category_id" invisible="1"/>
185 <field name="department_id" invisible="not context.get('set_visible',False)"/>
186 <field name="manager_id" invisible="1"/>
187 <field name="user_id" invisible="1"/>
192 <menuitem name="Leaves" parent="hr.menu_hr_root" id="menu_open_ask_holidays" sequence="20"/>
194 <record model="ir.actions.act_window" id="open_ask_holidays">
195 <field name="name">Leave Request</field>
196 <field name="res_model">hr.holidays</field>
197 <field name="view_type">form</field>
198 <field name="view_id" ref="edit_holiday_new"/>
199 <field name="context">{'default_type': 'remove', 'search_default_my_leaves':1}</field>
200 <field name="domain">[('type','=','remove')]</field>
201 <field name="search_view_id" ref="view_hr_holidays_filter"/>
202 <field name="help" type="html">
203 <p class="oe_view_nocontent_create">
204 Click to create a new leave request.
206 Once you have recorded your leave request, it will be sent
207 to a manager for validation. Be sure to set the right leave
208 type (recuperation, legal holidays, sickness) and the exact
209 number of open days related to your leave.
214 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">
215 <field name="sequence" eval="2"/>
216 <field name="view_mode">tree</field>
217 <field name="view_id" ref="view_holiday"/>
218 <field name="act_window_id" ref="open_ask_holidays"/>
221 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_form">
222 <field name="sequence" eval="3"/>
223 <field name="view_mode">form</field>
224 <field name="view_id" ref="edit_holiday_new"/>
225 <field name="act_window_id" ref="open_ask_holidays"/>
228 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_calendar">
229 <field name="sequence" eval="1"/>
230 <field name="view_mode">calendar</field>
231 <field name="view_id" ref="view_holiday_new_calendar"/>
232 <field name="act_window_id" ref="open_ask_holidays"/>
235 <menuitem parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
237 <record model="ir.actions.act_window" id="request_approve_holidays">
238 <field name="name">Requests to Approve</field>
239 <field name="res_model">hr.holidays</field>
240 <field name="view_type">form</field>
241 <field name="context">{'default_type': 'remove', 'search_default_approve':1}</field>
242 <field name="domain">[('type','=','remove')]</field>
243 <field name="view_id" ref="edit_holiday_new"/>
244 <field name="search_view_id" ref="view_hr_holidays_filter"/>
247 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_tree">
248 <field name="sequence" eval="1"/>
249 <field name="view_mode">tree</field>
250 <field name="view_id" ref="view_holiday"/>
251 <field name="act_window_id" ref="request_approve_holidays"/>
254 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_form">
255 <field name="sequence" eval="2"/>
256 <field name="view_mode">form</field>
257 <field name="view_id" ref="edit_holiday_new"/>
258 <field name="act_window_id" ref="request_approve_holidays"/>
261 <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"/>
263 <record model="ir.actions.act_window" id="open_allocation_holidays">
264 <field name="name">Allocation Requests</field>
265 <field name="res_model">hr.holidays</field>
266 <field name="view_type">form</field>
267 <field name="context">{'default_type':'add', 'search_default_my_leaves':1}</field>
268 <field name="domain">[('type','=','add')]</field>
269 <field name="view_id" ref="edit_holiday_new"/>
270 <field name="search_view_id" ref="view_hr_holidays_filter"/>
273 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_tree">
274 <field name="sequence" eval="1"/>
275 <field name="view_mode">tree</field>
276 <field name="view_id" ref="view_holiday_allocation_tree"/>
277 <field name="act_window_id" ref="open_allocation_holidays"/>
280 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_form">
281 <field name="sequence" eval="2"/>
282 <field name="view_mode">form</field>
283 <field name="view_id" ref="edit_holiday_new"/>
284 <field name="act_window_id" ref="open_allocation_holidays"/>
287 <menuitem parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
289 <record model="ir.actions.act_window" id="request_approve_allocation">
290 <field name="name">Allocation Requests to Approve</field>
291 <field name="res_model">hr.holidays</field>
292 <field name="view_type">form</field>
293 <field name="context">{'default_type': 'add', 'search_default_approve':1}</field>
294 <field name="domain">[('type','=','add')]</field>
295 <field name="view_id" ref="edit_holiday_new"/>
296 <field name="search_view_id" ref="view_hr_holidays_filter"/>
299 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_tree">
300 <field name="sequence" eval="1"/>
301 <field name="view_mode">tree</field>
302 <field name="view_id" ref="view_holiday_allocation_tree"/>
303 <field name="act_window_id" ref="request_approve_allocation"/>
306 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_form">
307 <field name="sequence" eval="2"/>
308 <field name="view_mode">form</field>
309 <field name="view_id" ref="edit_holiday_new"/>
310 <field name="act_window_id" ref="request_approve_allocation"/>
313 <menuitem parent="menu_open_ask_holidays" id="menu_request_approve_allocation" action="request_approve_allocation" groups="base.group_hr_manager"/>
315 <record model="ir.actions.act_window" id="open_company_allocation">
316 <field name="name">Leaves Summary</field>
317 <field name="res_model">hr.holidays</field>
318 <field name="view_type">form</field>
319 <field name="view_mode">tree,form</field>
320 <field name="view_id" eval="view_holiday_simple"/>
321 <field name="context">{'search_default_group_type': 1}</field>
322 <field name="domain">[('holiday_type','=','employee'), ('state', '!=', 'refuse')]</field>
323 <field name="search_view_id" ref="view_hr_holidays_filter"/>
326 <menuitem name="Leaves Summary" parent="menu_open_ask_holidays" id="menu_open_company_allocation" action="open_company_allocation" sequence="40"/>
328 <!-- Holidays status -->
329 <record id="view_holidays_status_filter" model="ir.ui.view">
330 <field name="name">hr.holidays.status.filter</field>
331 <field name="model">hr.holidays.status</field>
332 <field name="arch" type="xml">
333 <search string="Search Leave Type">
334 <field name="name" string="Leave Types"/>
335 <field name="categ_id"/>
340 <record model="ir.ui.view" id="edit_holiday_status_form">
341 <field name="name">hr.holidays.status.form</field>
342 <field name="model">hr.holidays.status</field>
343 <field name="arch" type="xml">
344 <form string="Leave Type">
345 <sheet string="Leave Type">
348 <field name="categ_id"/>
351 <page string="Details">
353 <group name="selection" string="Validation">
354 <field name="double_validation"/>
355 <field name="limit"/>
357 <group name="second" string="Misc">
358 <field name="color_name"/>
359 <field name="active"/>
369 <record model="ir.ui.view" id="view_holiday_status_tree">
370 <field name="name">hr.holidays.status.tree</field>
371 <field name="model">hr.holidays.status</field>
372 <field name="arch" type="xml">
373 <tree string="Leave Type">
375 <field name="max_leaves"/>
376 <field name="leaves_taken"/>
377 <field name="remaining_leaves"/>
382 <record model="ir.ui.view" id="view_holiday_status_normal_tree">
383 <field name="name">hr.holidays.status.normal.tree</field>
384 <field name="model">hr.holidays.status</field>
385 <field name="priority">35</field>
386 <field name="arch" type="xml">
387 <tree string="Leave Type">
389 <field name="limit"/>
394 <record id="view_hr_holidays_status_search" model="ir.ui.view">
395 <field name="name">hr.holidays.status.search</field>
396 <field name="model">hr.holidays.status</field>
397 <field name="arch" type="xml">
398 <search string="Leave Type">
399 <field name="name" string="Leave Types"/>
400 <field name="categ_id"/>
405 <record id="open_view_holiday_status" model="ir.actions.act_window">
406 <field name="name">Leave Types</field>
407 <field name="type">ir.actions.act_window</field>
408 <field name="res_model">hr.holidays.status</field>
409 <field name="view_type">form</field>
410 <field name="view_mode">tree,form</field>
411 <field name="view_id" eval="view_holiday_status_normal_tree"/>
412 <field name="search_view_id" ref="view_hr_holidays_status_search"/>
415 <menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
416 <menuitem name="Leaves Types" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10"/>
418 <!-- Holiday on resource leave -->
419 <record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
420 <field name="name">resource.calendar.leaves.form.inherit</field>
421 <field name="model">resource.calendar.leaves</field>
422 <field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
423 <field name="arch" type="xml">
424 <field name="name" position="after">
425 <field name="holiday_id"/>
431 <record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
432 <field name="name">Leaves</field>
433 <field name="type">ir.actions.act_window</field>
434 <field name="res_model">hr.holidays</field>
435 <field name="src_model">hr.employee</field>
436 <field name="view_type">form</field>
437 <field name="view_mode">tree,form</field>
438 <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
439 <field name="domain">[('type','=','remove')]</field>
440 <field name="view_id" eval="view_holiday"/>
443 <!-- Assing leave -->
444 <record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
445 <field name="name">hr.employee.leave.tree</field>
446 <field name="model">hr.employee</field>
447 <field name="priority" eval="20"/>
448 <field name="arch" type="xml">
449 <tree string="Assign Leaves" editable="bottom">
450 <field name="name" string="Employee"/>
451 <field name="remaining_leaves" string="Remaining Legal Leaves"/>
456 <record model="ir.actions.act_window" id="hr_holidays_leaves_assign_legal">
457 <field name="name">Allocate Leaves for Employees</field>
458 <field name="type">ir.actions.act_window</field>
459 <field name="res_model">hr.employee</field>
460 <field name="view_type">form</field>
461 <field name="view_mode">tree,form</field>
462 <field name="view_id" ref="hr_holidays_leaves_assign_tree_view"/>
463 <field name="help" type="html">
465 You can assign remaining Legal Leaves for each employee, OpenERP
466 will automatically create and validate allocation requests.
471 <!-- Hr employee inherit Legal Leaves -->
472 <record id="view_employee_form_leave_inherit" model="ir.ui.view">
473 <field name="name">hr.employee.leave.form.inherit</field>
474 <field name="model">hr.employee</field>
475 <field name="inherit_id" ref="hr.view_employee_form"/>
476 <field name="arch" type="xml">
477 <xpath expr="//group[@name='active_group']" position="before">
478 <group string="Leaves">
479 <label for="remaining_leaves"/>
481 <field name="remaining_leaves" class="oe_inline"/> days
485 <xpath expr="//div[@name='button_box']" position="inside">
486 <button name="%(act_hr_employee_holiday_request)d"
488 class="oe_stat_button"
490 groups="base.group_hr_user">
491 <field name="leaves_count" widget="statinfo" string="Leaves"/>
497 <record model="ir.ui.view" id="hr_kanban_view_employees_kanban">
498 <field name="name">HR - Employees Kanban with leave status</field>
499 <field name="model">hr.employee</field>
500 <field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
501 <field name="arch" type="xml">
502 <xpath expr="//templates" position="before">
503 <field name="current_leave_id"/>
504 <field name="current_leave_state"/>
505 <field name="leave_date_from"/>
506 <field name="leave_date_to"/>
508 <xpath expr="//div[@class='oe_employee_details']/ul/li[@id='last_login']" position="inside">
509 <span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
510 t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
511 t-att-title="record.leave_date_from.raw_value.toString('ddd dS MMM') + ' - ' + record.leave_date_to.raw_value.toString('ddd dS MMM')">
512 <field name="current_leave_id"/>
519 id="act_hr_leave_request_to_meeting"
520 name="Leave Meetings"
521 src_model="hr.holidays"
522 res_model="calendar.event"
523 view_mode="tree,form,calendar,gantt"