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="user_id" date_start="date_from" date_stop="date_to">
44 <field name="user_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="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
58 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
59 <button string="Refuse" name="refuse" states="confirm,validate1,validate" type="workflow" groups="base.group_hr_user"/>
60 <button string="Reset to New" name="set_to_draft" states="refuse" type="object" groups="base.group_hr_user"/>
61 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
63 <sheet string="Leave Request">
66 <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
67 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
68 <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."/>
71 <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"/>
72 <field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)" required="1" class="oe_inline"/>
75 <field name="number_of_days_temp" class="oe_inline"/> days
78 <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')], 'readonly':[('state','!=','draft'), ('state','!=','confirm')]}"/>
81 <field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" string="Mode" groups="base.group_hr_user"/>
82 <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" on_change="onchange_employee(employee_id)" groups="base.group_hr_user"/>
83 <field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
87 <div class="oe_chatter">
88 <field name="message_follower_ids" widget="mail_followers"/>
89 <field name="message_ids" widget="mail_thread"/>
95 <!-- Holidays: Allocation Request -->
96 <record model="ir.ui.view" id="allocation_leave_new">
97 <field name="name">Allocation Request</field>
98 <field name="model">hr.holidays</field>
99 <field name="arch" type="xml">
100 <form string="Allocation Request" version="7.0">
102 <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
103 <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
104 <button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user"/>
105 <button string="Reset to New" name="set_to_draft" states="cancel,refuse" type="object" groups="base.group_hr_user"/>
106 <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
111 <field name="name" required="1" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
112 <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
113 <label for="number_of_days_temp"/>
115 <field name="number_of_days_temp" class="oe_inline"/> days
119 <field name="holiday_type" on_change="onchange_type(holiday_type)"/>
120 <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')], 'invisible':[('holiday_type','=','category')]}"/>
121 <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')]}"/>
122 <field name="department_id" attrs="{'invisible':[('holiday_type','=','category')]}"/>
125 <field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..."/>
127 <div class="oe_chatter">
128 <field name="message_follower_ids" widget="mail_followers"/>
129 <field name="message_ids" widget="mail_thread"/>
135 <record model="ir.ui.view" id="view_holiday_allocation_tree">
136 <field name="name">hr.holidays.allocation.tree</field>
137 <field name="model">hr.holidays</field>
138 <field name="arch" type="xml">
139 <tree colors="red:state == 'refuse';blue:state == 'draft';black:state in ('confirm','validate','validate1')" string="Allocation Requests">
140 <field name="employee_id"/>
141 <field name="holiday_type"/>
142 <field name="category_id"/>
143 <field name="department_id" invisible="1"/>
144 <field name="holiday_status_id"/>
146 <field name="number_of_days" string="Allocated Days" sum="Remaining Days"/>
147 <field name="manager_id" invisible="1"/>
148 <field name="user_id" invisible="1"/>
149 <!--field name="type"/-->
150 <field name="state"/>
155 <!-- Holidays: Leaves Management -->
156 <record model="ir.ui.view" id="allocation_company_new">
157 <field name="name">Leaves Management</field>
158 <field name="model">hr.holidays</field>
159 <field name="arch" type="xml">
160 <form string="Leaves Management" version="7.0">
162 <button string="Submit to Manager" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
163 <button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
164 <button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
165 <button string="Reset to New" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
166 <field name="state"/>
169 <field name="holiday_status_id"/>
171 <field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
172 <field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
173 <field name="number_of_days_temp"/>
174 <field name="manager_id"/>
176 <field name="name" placeholder="Add a reason..."/>
181 <record model="ir.ui.view" id="view_holiday_simple">
182 <field name="name">hr.holidays.report_tree</field>
183 <field name="model">hr.holidays</field>
184 <field name="priority">20</field>
185 <field name="arch" type="xml">
186 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leaves Summary">
187 <field name="employee_id"/>
188 <field name="category_id" invisible="1"/>
189 <field name="department_id" invisible="1"/>
192 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
193 <field name="date_from"/>
194 <field name="date_to"/>
195 <field name="holiday_status_id"/>
196 <field name="manager_id" invisible="1"/>
197 <field name="user_id" invisible="1"/>
198 <field name="state"/>
203 <record model="ir.ui.view" id="view_holiday">
204 <field name="name">hr.holidays.tree</field>
205 <field name="model">hr.holidays</field>
206 <field name="arch" type="xml">
207 <tree colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leave Requests">
208 <field name="employee_id"/>
209 <field name="holiday_type" string="Mode" groups="base.group_hr_user"/>
211 <field name="date_from"/>
212 <field name="date_to"/>
213 <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
214 <field name="state"/>
215 <field name="category_id" invisible="1"/>
216 <field name="department_id" invisible="not context.get('set_visible',False)"/>
217 <field name="holiday_status_id" invisible="1"/>
218 <field name="manager_id" invisible="1"/>
219 <field name="user_id" invisible="1"/>
224 <menuitem name="Leaves" parent="hr.menu_hr_root" id="menu_open_ask_holidays" sequence="20"/>
226 <record model="ir.actions.act_window" id="open_ask_holidays">
227 <field name="name">Leave Requests</field>
228 <field name="res_model">hr.holidays</field>
229 <field name="view_type">form</field>
230 <field name="view_id" ref="edit_holiday_new"/>
231 <field name="context">{'default_type': 'remove', 'search_default_my_leaves':1}</field>
232 <field name="domain">[('type','=','remove')]</field>
233 <field name="search_view_id" ref="view_hr_holidays_filter"/>
234 <field name="help" type="html">
235 <p class="oe_view_nocontent_create">
236 Click to create a new leave request.
238 Once you have recorded your leave request, it will be sent
239 to a manager for validation. Be sure to set the right leave
240 type (recuperation, legal holidays, sickness) and the exact
241 number of open days related to your leave.
246 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">
247 <field name="sequence" eval="2"/>
248 <field name="view_mode">tree</field>
249 <field name="view_id" ref="view_holiday"/>
250 <field name="act_window_id" ref="open_ask_holidays"/>
253 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_form">
254 <field name="sequence" eval="3"/>
255 <field name="view_mode">form</field>
256 <field name="view_id" ref="edit_holiday_new"/>
257 <field name="act_window_id" ref="open_ask_holidays"/>
260 <record model="ir.actions.act_window.view" id="action_open_ask_holidays_calendar">
261 <field name="sequence" eval="1"/>
262 <field name="view_mode">calendar</field>
263 <field name="view_id" ref="view_holiday_new_calendar"/>
264 <field name="act_window_id" ref="open_ask_holidays"/>
267 <menuitem parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
269 <record model="ir.actions.act_window" id="request_approve_holidays">
270 <field name="name">Requests to Approve</field>
271 <field name="res_model">hr.holidays</field>
272 <field name="view_type">form</field>
273 <field name="context">{'default_type': 'remove', 'search_default_approve':1}</field>
274 <field name="domain">[('type','=','remove')]</field>
275 <field name="view_id" ref="edit_holiday_new"/>
276 <field name="search_view_id" ref="view_hr_holidays_filter"/>
279 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_tree">
280 <field name="sequence" eval="1"/>
281 <field name="view_mode">tree</field>
282 <field name="view_id" ref="view_holiday"/>
283 <field name="act_window_id" ref="request_approve_holidays"/>
286 <record model="ir.actions.act_window.view" id="action_request_approve_holidays_form">
287 <field name="sequence" eval="2"/>
288 <field name="view_mode">form</field>
289 <field name="view_id" ref="edit_holiday_new"/>
290 <field name="act_window_id" ref="request_approve_holidays"/>
293 <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"/>
295 <record model="ir.actions.act_window" id="open_allocation_holidays">
296 <field name="name">Allocation Requests</field>
297 <field name="res_model">hr.holidays</field>
298 <field name="view_type">form</field>
299 <field name="context">{'default_type':'add', 'search_default_my_leaves':1}</field>
300 <field name="domain">[('type','=','add')]</field>
301 <field name="view_id" ref="allocation_leave_new"/>
302 <field name="search_view_id" ref="view_hr_holidays_filter"/>
305 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_tree">
306 <field name="sequence" eval="1"/>
307 <field name="view_mode">tree</field>
308 <field name="view_id" ref="view_holiday_allocation_tree"/>
309 <field name="act_window_id" ref="open_allocation_holidays"/>
312 <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_form">
313 <field name="sequence" eval="2"/>
314 <field name="view_mode">form</field>
315 <field name="view_id" ref="allocation_leave_new"/>
316 <field name="act_window_id" ref="open_allocation_holidays"/>
319 <menuitem parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
321 <record model="ir.actions.act_window" id="request_approve_allocation">
322 <field name="name">Allocation Requests to Approve</field>
323 <field name="res_model">hr.holidays</field>
324 <field name="view_type">form</field>
325 <field name="context">{'default_type': 'add', 'search_default_approve':1}</field>
326 <field name="domain">[('type','=','add')]</field>
327 <field name="view_id" ref="allocation_leave_new"/>
328 <field name="search_view_id" ref="view_hr_holidays_filter"/>
331 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_tree">
332 <field name="sequence" eval="1"/>
333 <field name="view_mode">tree</field>
334 <field name="view_id" ref="view_holiday_allocation_tree"/>
335 <field name="act_window_id" ref="request_approve_allocation"/>
338 <record model="ir.actions.act_window.view" id="action_request_approve_allocation_form">
339 <field name="sequence" eval="2"/>
340 <field name="view_mode">form</field>
341 <field name="view_id" ref="allocation_leave_new"/>
342 <field name="act_window_id" ref="request_approve_allocation"/>
345 <menuitem parent="menu_open_ask_holidays" id="menu_request_approve_allocation" action="request_approve_allocation" groups="base.group_hr_manager"/>
347 <record model="ir.actions.act_window" id="open_company_allocation">
348 <field name="name">Leaves Summary</field>
349 <field name="res_model">hr.holidays</field>
350 <field name="view_type">form</field>
351 <field name="view_mode">tree,form</field>
352 <field name="view_id" eval="view_holiday_simple"/>
353 <field name="context">{'search_default_group_type': 1, 'search_default_validated': 1}</field>
354 <field name="domain">[('holiday_type','=','employee')]</field>
355 <field name="search_view_id" ref="view_hr_holidays_filter"/>
358 <menuitem name="Leaves Summary" parent="menu_open_ask_holidays" id="menu_open_company_allocation" action="open_company_allocation" sequence="40"/>
360 <!-- Holidays status -->
361 <record id="view_holidays_status_filter" model="ir.ui.view">
362 <field name="name">hr.holidays.status.filter</field>
363 <field name="model">hr.holidays.status</field>
364 <field name="arch" type="xml">
365 <search string="Search Leave Type">
366 <field name="name" string="Leave Types"/>
367 <field name="categ_id"/>
372 <record model="ir.ui.view" id="edit_holiday_status_form">
373 <field name="name">hr.holidays.status.form</field>
374 <field name="model">hr.holidays.status</field>
375 <field name="arch" type="xml">
376 <form string="Leave Type" version="7.0">
379 <field name="categ_id"/>
382 <page string="Details">
384 <group name="selection" string="Validation">
385 <field name="double_validation"/>
386 <field name="limit"/>
388 <group name="second" string="Misc">
389 <field name="color_name"/>
390 <field name="active"/>
399 <record model="ir.ui.view" id="view_holiday_status_tree">
400 <field name="name">hr.holidays.status.tree</field>
401 <field name="model">hr.holidays.status</field>
402 <field name="arch" type="xml">
403 <tree string="Leave Type">
405 <field name="max_leaves"/>
406 <field name="leaves_taken"/>
407 <field name="remaining_leaves"/>
412 <record model="ir.ui.view" id="view_holiday_status_normal_tree">
413 <field name="name">hr.holidays.status.normal.tree</field>
414 <field name="model">hr.holidays.status</field>
415 <field name="priority">35</field>
416 <field name="arch" type="xml">
417 <tree string="Leave Type">
419 <field name="limit"/>
424 <record id="view_hr_holidays_status_search" model="ir.ui.view">
425 <field name="name">hr.holidays.status.search</field>
426 <field name="model">hr.holidays.status</field>
427 <field name="arch" type="xml">
428 <search string="Leave Type">
429 <field name="name" string="Leave Types"/>
430 <field name="categ_id"/>
435 <record id="open_view_holiday_status" model="ir.actions.act_window">
436 <field name="name">Leave Types</field>
437 <field name="type">ir.actions.act_window</field>
438 <field name="res_model">hr.holidays.status</field>
439 <field name="view_type">form</field>
440 <field name="view_mode">tree,form</field>
441 <field name="view_id" eval="view_holiday_status_normal_tree"/>
442 <field name="search_view_id" ref="view_hr_holidays_status_search"/>
445 <menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
446 <menuitem name="Leaves Types" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10"/>
448 <!-- Holiday on resource leave -->
449 <record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
450 <field name="name">resource.calendar.leaves.form.inherit</field>
451 <field name="model">resource.calendar.leaves</field>
452 <field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
453 <field name="arch" type="xml">
454 <field name="name" position="after">
455 <field name="holiday_id"/>
461 <record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
462 <field name="name">Leaves</field>
463 <field name="type">ir.actions.act_window</field>
464 <field name="res_model">hr.holidays</field>
465 <field name="src_model">hr.employee</field>
466 <field name="view_type">form</field>
467 <field name="view_mode">tree,form</field>
468 <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
469 <field name="domain">[('type','=','remove')]</field>
470 <field name="view_id" eval="view_holiday"/>
473 <!-- Assing leave -->
474 <record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
475 <field name="name">hr.employee.leave.tree</field>
476 <field name="model">hr.employee</field>
477 <field name="priority" eval="20"/>
478 <field name="arch" type="xml">
479 <tree string="Assign Leaves" editable="bottom">
480 <field name="name" string="Employee"/>
481 <field name="remaining_leaves" string="Remaining Legal Leaves"/>
486 <record model="ir.actions.act_window" id="hr_holidays_leaves_assign_legal">
487 <field name="name">Allocate Leaves for Employees</field>
488 <field name="type">ir.actions.act_window</field>
489 <field name="res_model">hr.employee</field>
490 <field name="view_type">form</field>
491 <field name="view_mode">tree,form</field>
492 <field name="view_id" ref="hr_holidays_leaves_assign_tree_view"/>
493 <field name="help" type="html">
495 You can assign remaining Legal Leaves for each employee, OpenERP
496 will automatically create and validate allocation requests.
501 <!-- Hr employee inherit Legal Leaves -->
502 <record id="view_employee_form_leave_inherit" model="ir.ui.view">
503 <field name="name">hr.employee.leave.form.inherit</field>
504 <field name="model">hr.employee</field>
505 <field name="inherit_id" ref="hr.view_employee_form"/>
506 <field name="arch" type="xml">
507 <xpath expr="//group[@name='active_group']" position="before">
508 <group string="Leaves">
509 <label for="remaining_leaves"/>
511 <field name="remaining_leaves" class="oe_inline"/> days
515 <xpath expr="//div[@name='button_box']" position="inside">
516 <button name="%(act_hr_employee_holiday_request)d" string="Leaves" type="action" groups="base.group_hr_user"/>
521 <record model="ir.ui.view" id="hr_kanban_view_employees_kanban">
522 <field name="name">HR - Employees Kanban with leave status</field>
523 <field name="model">hr.employee</field>
524 <field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
525 <field name="arch" type="xml">
526 <xpath expr="//templates" position="before">
527 <field name="current_leave_id"/>
528 <field name="current_leave_state"/>
529 <field name="leave_date_from"/>
530 <field name="leave_date_to"/>
532 <xpath expr="//div[@class='oe_employee_details']/ul/li[@id='last_login']" position="inside">
533 <span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
534 t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
535 t-att-title="record.leave_date_from.raw_value.toString('ddd dS MMM') + ' - ' + record.leave_date_to.raw_value.toString('ddd dS MMM')">
536 <field name="current_leave_id"/>
543 id="act_hr_leave_request_to_meeting"
544 name="Leave Meetings"
545 src_model="hr.holidays"
546 res_model="crm.meeting"
547 view_mode="tree,form,calendar,gantt"