summaryrefslogtreecommitdiff
path: root/addons/hr_holidays/views
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/hr_holidays/views
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/hr_holidays/views')
-rw-r--r--addons/hr_holidays/views/hr_holidays_views.xml103
-rw-r--r--addons/hr_holidays/views/hr_leave_allocation_views.xml454
-rw-r--r--addons/hr_holidays/views/hr_leave_template.xml27
-rw-r--r--addons/hr_holidays/views/hr_leave_type_views.xml130
-rw-r--r--addons/hr_holidays/views/hr_leave_views.xml752
-rw-r--r--addons/hr_holidays/views/hr_views.xml322
-rw-r--r--addons/hr_holidays/views/mail_activity_views.xml11
-rw-r--r--addons/hr_holidays/views/resource_views.xml14
8 files changed, 1813 insertions, 0 deletions
diff --git a/addons/hr_holidays/views/hr_holidays_views.xml b/addons/hr_holidays/views/hr_holidays_views.xml
new file mode 100644
index 00000000..be5bf38f
--- /dev/null
+++ b/addons/hr_holidays/views/hr_holidays_views.xml
@@ -0,0 +1,103 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<odoo>
+
+ <menuitem
+ name="Time Off"
+ id="menu_hr_holidays_root"
+ sequence="95"
+ web_icon="hr_holidays,static/description/icon.png"
+ groups="base.group_user"/>
+
+ <menuitem
+ id="menu_hr_holidays_my_leaves"
+ name="My Time Off"
+ parent="menu_hr_holidays_root"
+ sequence="1"/>
+
+ <menuitem
+ id="hr_leave_menu_new_request"
+ parent="menu_hr_holidays_my_leaves"
+ action="hr_leave_action_new_request"
+ sequence="1"/>
+
+ <menuitem
+ id="hr_leave_menu_my"
+ parent="menu_hr_holidays_my_leaves"
+ action="hr_leave_action_my"
+ sequence="2"/>
+
+ <menuitem
+ id="menu_open_allocation"
+ name="My Allocation Requests"
+ parent="menu_hr_holidays_my_leaves"
+ action="hr_leave_allocation_action_my"
+ sequence="3"/>
+
+ <menuitem
+ id="menu_hr_holidays_dashboard"
+ name="Everyone"
+ parent="menu_hr_holidays_root"
+ sequence="2"
+ action="action_hr_holidays_dashboard"/>
+
+ <menuitem
+ id="menu_hr_holidays_approvals"
+ name="Managers"
+ parent="menu_hr_holidays_root"
+ sequence="3"/>
+
+ <menuitem
+ id="menu_open_department_leave_approve"
+ name="Time Off"
+ parent="menu_hr_holidays_approvals"
+ action="hr_leave_action_action_approve_department"
+ sequence="1"/>
+
+ <menuitem
+ id="hr_holidays_menu_manager_approve_allocations"
+ name="Allocations"
+ parent="menu_hr_holidays_approvals"
+ action="hr_leave_allocation_action_approve_department"
+ sequence="2"/>
+
+ <menuitem
+ id="menu_hr_holidays_report"
+ name="Reporting"
+ parent="menu_hr_holidays_root"
+ groups="hr_holidays.group_hr_holidays_manager"
+ sequence="4"/>
+
+ <menuitem
+ id="menu_hr_available_holidays_report_tree"
+ name="by Employee"
+ parent="menu_hr_holidays_report"
+ action="action_hr_available_holidays_report"
+ sequence="1"/>
+
+ <menuitem
+ id="menu_hr_holidays_summary_all"
+ name="by Type"
+ parent="menu_hr_holidays_report"
+ action="act_hr_employee_holiday_request"
+ sequence="3"/>
+
+ <menuitem
+ id="menu_hr_holidays_configuration"
+ name="Configuration"
+ parent="menu_hr_holidays_root"
+ sequence="5"/>
+
+ <menuitem
+ id="hr_holidays_status_menu_configuration"
+ action="open_view_holiday_status"
+ name="Time Off Types"
+ parent="menu_hr_holidays_configuration"
+ groups="hr_holidays.group_hr_holidays_user"
+ sequence="1"/>
+
+ <menuitem id="hr_holidays_menu_config_activity_type"
+ action="mail_activity_type_action_config_hr_holidays"
+ parent="menu_hr_holidays_configuration"
+ groups="base.group_no_one"/>
+
+</odoo>
diff --git a/addons/hr_holidays/views/hr_leave_allocation_views.xml b/addons/hr_holidays/views/hr_leave_allocation_views.xml
new file mode 100644
index 00000000..9b62757d
--- /dev/null
+++ b/addons/hr_holidays/views/hr_leave_allocation_views.xml
@@ -0,0 +1,454 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<odoo>
+
+ <record id="view_hr_leave_allocation_filter" model="ir.ui.view">
+ <field name="name">hr.holidays.filter_allocations</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="arch" type="xml">
+ <search string="Search allocations">
+ <field name="employee_id"/>
+ <field name="name"/>
+ <field name="allocation_type"/>
+ <filter domain="[('state','in',('confirm', 'validate1'))]" string="To Approve" name="approve"/>
+ <filter domain="[('state', '=', 'validate1')]" string="Need Second Approval" name="second_approval"/>
+ <filter string="Approved Allocations" domain="[('state', '=', 'validate')]" name="validated"/>
+ <filter string="Accrual Allocations" domain="[('allocation_type', '=', 'accrual')]" name="accrual_allocation"/>
+ <separator/>
+ <filter name="active_types" string="Active Types" domain="[('holiday_status_id.active', '=', True)]" help="Filters only on allocations that belong to an time off type that is 'active' (active field is True)"/>
+ <separator/>
+ <filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/>
+ <separator/>
+ <filter string="People I Manage" name="managed_people" domain="[('employee_id.leave_manager_id', '=', uid)]" help="Time off of people you are manager of"/>
+ <filter string="My Team Time Off" name="my_team_leaves" domain="[('employee_id.parent_id.user_id', '=', uid)]" groups="hr_holidays.group_hr_holidays_manager" help="Time Off of Your Team Member"/>
+ <separator/>
+ <filter name="year" string="Current Year"
+ domain="[('holiday_status_id.active', '=', True)]" help="Active Allocations"/>
+ <separator/>
+ <filter string="My Allocations" name="my_leaves" domain="[('employee_id.user_id', '=', uid)]"/>
+ <separator/>
+ <field name="department_id" operator="child_of"/>
+ <field name="holiday_status_id"/>
+ <filter invisible="1" string="Late Activities" name="activities_overdue"
+ domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
+ help="Show all records which has next action date is before today"/>
+ <filter invisible="1" string="Today Activities" name="activities_today"
+ domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
+ <filter invisible="1" string="Future Activities" name="activities_upcoming_all"
+ domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))
+ ]"/>
+ <group expand="0" string="Group By">
+ <filter name="group_employee" string="Employee" context="{'group_by':'employee_id'}"/>
+ <filter name="group_type" string="Type" context="{'group_by':'holiday_status_id'}"/>
+ <filter name="group_state" string="Status" context="{'group_by': 'state'}"/>
+ </group>
+ <searchpanel>
+ <field name="state" string="Status"/>
+ </searchpanel>
+ </search>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_view_form" model="ir.ui.view">
+ <field name="name">hr.leave.allocation.view.form</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="priority">32</field>
+ <field name="arch" type="xml">
+ <form string="Allocation Request">
+ <field name="can_reset" invisible="1"/>
+ <field name="can_approve" invisible="1"/>
+ <field name="holiday_type" invisible="1"/>
+ <header>
+ <button string="Confirm" name="action_confirm" states="draft" type="object" class="oe_highlight"/>
+ <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate"/>
+ </header>
+ <sheet>
+ <div class="oe_button_box" name="button_box">
+ <button
+ class="oe_stat_button"
+ icon="fa-calendar"
+ type="action"
+ attrs="{'invisible': [('holiday_type', '!=', 'employee')]}"
+ name="%(hr_leave_action_action_approve_department)d"
+ context="{'search_default_employee_id': [employee_id], 'search_default_holiday_status_id': [holiday_status_id], 'default_holiday_status_id': holiday_status_id}"
+ help="Time off Taken/Total Allocated">
+ <div class="o_stat_info">
+ <span class="o_stat_value">
+ <field name="leaves_taken" digits="[42,1]"/>/<field name="max_leaves" digits="[42,1]"/>
+ </span>
+ <span class="o_stat_text">
+ Time Off
+ </span>
+ </div>
+ </button>
+ </div>
+ <div class="oe_title">
+ <h2><field name="name" placeholder="e.g. Public Holiday Allocation" attrs="{'readonly': [('state', 'not in', ('draft', 'confirm'))]}" required="1"/></h2>
+ </div>
+ <group>
+ <group>
+ <field name="type_request_unit" invisible="1"/>
+ <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
+
+ <field name="allocation_type" invisible="1" widget="radio"/>
+
+ <field name="number_of_days_display" invisible="1"/>
+ <field name="number_of_days" invisible="1"/>
+ <div class="o_td_label">
+ <label for="number_of_days" string="Duration" attrs="{'invisible': [('allocation_type', '=', 'accrual')]}"/>
+ <label for="number_of_days" string="Extra days" attrs="{'invisible': [('allocation_type', '!=', 'accrual')]}"/>
+ </div>
+ <div>
+ <field name="number_of_days_display" class="oe_inline" nolabel="1"
+ attrs="{'readonly': ['|', ('type_request_unit', '=', 'hour'), ('state', 'not in', ('draft', 'confirm'))], 'invisible': [('type_request_unit', '=', 'hour')]}"/>
+ <field name="number_of_hours_display" class="oe_inline" nolabel="1"
+ attrs="{'readonly': ['|', ('type_request_unit', '!=', 'hour'), ('state', 'not in', ('draft', 'confirm'))], 'invisible': [('type_request_unit', '!=', 'hour')]}"/>
+ <span class="ml8" attrs="{'invisible': [('type_request_unit', '=', 'hour')]}">Days</span>
+ <span class="ml8" attrs="{'invisible': [('type_request_unit', '!=', 'hour')]}">Hours</span>
+ </div>
+ </group>
+ <group name="alloc_right_col">
+ <field name="employee_id" invisible="1" groups="hr_holidays.group_hr_holidays_user"/>
+ <field name="department_id" invisible="1"/>
+ </group>
+ </group>
+ <field name="notes" nolabel="1" placeholder="Add a reason..."/>
+ </sheet>
+ <div class="oe_chatter">
+ <field name="message_follower_ids"/>
+ <field name="activity_ids"/>
+ <field name="message_ids"/>
+ </div>
+ </form>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_view_form_manager" model="ir.ui.view">
+ <field name="name">hr.leave.allocation.view.form.manager</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="inherit_id" ref="hr_holidays.hr_leave_allocation_view_form"/>
+ <field name="mode">primary</field>
+ <field name="priority">16</field>
+ <field name="arch" type="xml">
+ <xpath expr="//button[@name='action_confirm']" position="after">
+ <button string="Approve" name="action_approve" states="confirm" type="object" class="oe_highlight"
+ attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', '!=', 'confirm')]}"/>
+ <button string="Validate" name="action_validate" states="validate1" type="object" class="oe_highlight"/>
+ <button string="Refuse" name="action_refuse" type="object"
+ attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', 'not in', ('confirm','validate1','validate'))]}"/>
+ <button string="Mark as Draft" name="action_draft" type="object"
+ attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
+ </xpath>
+ <xpath expr="//field[@name='employee_id']" position="before">
+ <field name="holiday_type" string="Mode" groups="hr_holidays.group_hr_holidays_user" context="{'employee_id':employee_id}" />
+ </xpath>
+ <xpath expr="//field[@name='employee_id']" position="replace">
+ <field name="employee_id" groups="hr_holidays.group_hr_holidays_user"
+ attrs="{'required': [('holiday_type', '=', 'employee')], 'invisible': [('holiday_type', '!=', 'employee')]}"/>
+ </xpath>
+ <xpath expr="//field[@name='employee_id']" position="after">
+ <field name="category_id"
+ attrs="{'required': [('holiday_type', '=', 'category')], 'invisible': [('holiday_type', '!=', 'category')]}"/>
+ </xpath>
+ <xpath expr="//field[@name='department_id']" position="replace">
+ <field name="department_id" groups="hr_holidays.group_hr_holidays_user"
+ attrs="{'required': [('holiday_type', '=', 'department')], 'invisible': [('holiday_type', '!=', 'department')]}"/>
+ </xpath>
+ <xpath expr="//field[@name='department_id']" position="after">
+ <field name="mode_company_id" string="Company" groups="hr_holidays.group_hr_holidays_user"
+ attrs="{'required': [('holiday_type', '=', 'company')], 'invisible': [('holiday_type', '!=', 'company')]}"/>
+ </xpath>
+ <xpath expr="//field[@name='allocation_type']" position="attributes">
+ <attribute name="invisible">0</attribute>
+ </xpath>
+ <xpath expr="//field[@name='allocation_type']" position="after">
+ <label for="date_from" attrs="{'invisible': [('allocation_type', '=', 'regular')]}"/>
+ <div class="o_row" attrs="{'invisible': [('allocation_type', '=', 'regular')]}">
+ <field name="date_from" class="mr-2" attrs="{'required': [('allocation_type', '=', 'accrual')]}" />
+ Run until <field name="date_to" help="If no value set, runs indefinitely" class="ml-2"/>
+ </div>
+ <label for="date_from" invisible="1"/>
+ <div attrs="{'invisible': [('allocation_type', '=', 'regular')]}">
+ <div class="o_row">
+ <span>Add</span>
+ <field name="number_per_interval" class="ml8"
+ attrs="{'required': [('allocation_type', '=', 'accrual')]}"/>
+ <field name="unit_per_interval"
+ attrs="{'required': [('allocation_type', '=', 'accrual')]}"/>
+ <span class="ml8">of time off every</span>
+ <field name="interval_number" class="ml8"
+ attrs="{'required': [('allocation_type', '=', 'accrual')]}"/>
+ <field name="interval_unit"
+ attrs="{'required': [('allocation_type', '=', 'accrual')]}"/>
+ </div>
+ </div>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_view_tree" model="ir.ui.view">
+ <field name="name">hr.leave.allocation.view.tree</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="priority">16</field>
+ <field name="arch" type="xml">
+ <tree string="Allocation Requests" sample="1">
+ <field name="employee_id"/>
+ <field name="department_id" optional="hide"/>
+ <field name="holiday_status_id" class="font-weight-bold"/>
+ <field name="name"/>
+ <field name="duration_display" string="Duration"/>
+ <field name="message_needaction" invisible="1"/>
+ <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state in ('confirm','validate1')" decoration-success="state == 'validate'"/>
+ <button string="Approve" name="action_approve" type="object"
+ icon="fa-thumbs-up"
+ states="confirm"
+ groups="hr_holidays.group_hr_holidays_responsible"/>
+ <button string="Validate" name="action_validate" type="object"
+ icon="fa-check"
+ states="validate1"
+ groups="hr_holidays.group_hr_holidays_manager"/>
+ <button string="Refuse" name="action_refuse" type="object"
+ icon="fa-times"
+ states="confirm,validate1"
+ groups="hr_holidays.group_hr_holidays_manager"/>
+ <field name="activity_exception_decoration" widget="activity_exception"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_view_tree_my" model="ir.ui.view">
+ <field name="name">hr.leave.allocation.view.tree.my</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="inherit_id" ref="hr_leave_allocation_view_tree"/>
+ <field name="mode">primary</field>
+ <field name="priority">32</field>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='employee_id']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//field[@name='department_id']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//button[@name='action_approve']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//button[@name='action_validate']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//button[@name='action_refuse']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_view_search_my" model="ir.ui.view">
+ <field name="name">hr.leave.allocation.view.search.my</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="inherit_id" ref="view_hr_leave_allocation_filter"/>
+ <field name="mode">primary</field>
+ <field name="priority">32</field>
+ <field name="arch" type="xml">
+ <xpath expr="//searchpanel" position="replace"/>
+ <xpath expr="//filter[@name='message_needaction']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='managed_people']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='my_team_leaves']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='my_leaves']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_view_search_manager" model="ir.ui.view">
+ <field name="name">hr.leave.allocation.view.search.my</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="inherit_id" ref="view_hr_leave_allocation_filter"/>
+ <field name="mode">primary</field>
+ <field name="priority">32</field>
+ <field name="arch" type="xml">
+ <xpath expr="//filter[@name='message_needaction']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='my_leaves']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_view_kanban" model="ir.ui.view">
+ <field name="name">hr.leave.allocation.view.kanban</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="arch" type="xml">
+ <kanban class="o_kanban_mobile" create="0" sample="1">
+ <field name="employee_id"/>
+ <field name="date_from"/>
+ <field name="date_to"/>
+ <field name="name"/>
+ <field name="number_of_days"/>
+ <field name="can_approve"/>
+ <field name="state"/>
+ <field name="holiday_status_id"/>
+ <templates>
+ <t t-name="kanban-box">
+ <div class="oe_kanban_global_click container">
+ <div class="row no-gutters">
+ <div class="col-2">
+ <img t-att-src="kanban_image('hr.employee', 'image_128', record.employee_id.raw_value)"
+ t-att-title="record.employee_id.value"
+ t-att-alt="record.employee_id.value"
+ class="oe_kanban_avatar o_image_40_cover float-left mr4"/>
+ </div>
+ <div class="col-10">
+ <span class="badge badge-pill float-right mt4 mr16"><t t-esc="record.number_of_days.value"/> days</span>
+ <strong class="o_kanban_record_title"><t t-esc="record.employee_id.value"/></strong>
+ <div class="text-muted o_kanban_record_subtitle">
+ <t t-esc="record.holiday_status_id.value"/>
+ </div>
+ <div class="o_dropdown_kanban dropdown" groups="base.group_user">
+ <a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" href="#" aria-label="Dropdown menu" title="Dropdown menu">
+ <span class="fa fa-ellipsis-v"/>
+ </a>
+ <div class="dropdown-menu" role="menu">
+ <a t-if="widget.editable" role="menuitem" type="edit" class="dropdown-item">Edit Allocation</a>
+ <a t-if="widget.deletable" role="menuitem" type="delete" class="dropdown-item">Delete</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row no-gutters" t-if="['validate', 'refuse'].includes(record.state.raw_value)">
+ <div class="col-2"/>
+ <div class="col-10">
+ <span t-if="record.state.raw_value === 'validate'" class="fa fa-check text-muted" aria-label="validated"/>
+ <span t-else="" class="fa fa-ban text-muted" aria-label="refused"/>
+ <span class="text-muted"><t t-esc="record.state.value"/></span>
+ </div>
+ </div>
+ <div class="o_kanban_record_bottom" t-if="record.can_approve.raw_value" >
+ <div class="oe_kanban_bottom_left" t-if="record.can_approve.raw_value">
+ <button t-if="record.state.raw_value === 'confirm'" name="action_approve" type="object" class="btn btn-primary btn-sm mt8">Approve</button>
+ <button t-if="record.state.raw_value === 'validate1'" name="action_validate" type="object" class="btn btn-primary btn-sm mt8">Validate</button>
+ <button t-if="['confirm', 'validate1'].includes(record.state.raw_value)" name="action_refuse" type="object" class="btn btn-secondary btn-sm mt8">Refuse</button>
+ </div>
+ </div>
+ </div>
+ </t>
+ </templates>
+ </kanban>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_view_activity" model="ir.ui.view">
+ <field name="name">hr.leave.allocation.view.activity</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="arch" type="xml">
+ <activity string="Allocation Requests">
+ <field name="employee_id"/>
+ <templates>
+ <div t-name="activity-box">
+ <img t-att-src="activity_image('hr.employee', 'image_128', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
+ <div>
+ <field name="employee_id"/>
+ <span class="ml-3 text-muted">
+ <field name="number_of_days"/> days
+ </span>
+ <field name="holiday_status_id" muted="1" display="full"/>
+ </div>
+ </div>
+ </templates>
+ </activity>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_action_my" model="ir.actions.act_window">
+ <field name="name">My Allocations</field>
+ <field name="res_model">hr.leave.allocation</field>
+ <field name="view_mode">tree,kanban,form,activity</field>
+ <field name="search_view_id" ref="hr_holidays.hr_leave_allocation_view_search_my"/>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new time off allocation request
+ </p><p>
+ Time Off Officers allocate time off days to employees (e.g. paid time off).<br/>
+ Employees request allocations to Time Off Officers (e.g. recuperation days).
+ </p>
+ </field>
+ <field name="context">{}</field>
+ <field name="domain">[('employee_id.user_id', '=', uid)]</field>
+ </record>
+ <record id="hr_leave_allocation_action_my_view_tree" model="ir.actions.act_window.view">
+ <field name="sequence">1</field>
+ <field name="view_mode">tree</field>
+ <field name="act_window_id" ref="hr_leave_allocation_action_my"/>
+ <field name="view_id" ref="hr_leave_allocation_view_tree_my"/>
+ </record>
+ <record id="hr_leave_allocation_action_my_view_form" model="ir.actions.act_window.view">
+ <field name="sequence">2</field>
+ <field name="view_mode">form</field>
+ <field name="act_window_id" ref="hr_leave_allocation_action_my"/>
+ <field name="view_id" ref="hr_leave_allocation_view_form"/>
+ </record>
+
+ <record id="hr_leave_allocation_action_all" model="ir.actions.act_window">
+ <field name="name">All Allocations</field>
+ <field name="res_model">hr.leave.allocation</field>
+ <field name="view_mode">tree,kanban,form,activity</field>
+ <field name="context">{}</field>
+ <field name="domain">[]</field>
+ <field name="search_view_id" ref="hr_holidays.hr_leave_allocation_view_search_manager"/>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new time off allocation request
+ </p><p>
+ Time Off Officers allocate time off days to employees (e.g. paid time off).<br/>
+ Employees request allocations to Time Off Officers (e.g. recuperation days).
+ </p>
+ </field>
+ </record>
+
+ <record id="hr_leave_allocation_action_approve_department" model="ir.actions.act_window">
+ <field name="name">Allocations</field>
+ <field name="res_model">hr.leave.allocation</field>
+ <field name="view_mode">tree,form,kanban,activity</field>
+ <field name="context">{'search_default_managed_people': 1}</field>
+ <field name="domain">[]</field>
+ <field name="search_view_id" ref="hr_holidays.hr_leave_allocation_view_search_manager"/>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new time off allocation
+ </p><p>
+ Time Off Officers allocate time off days to employees (e.g. paid time off).<br/>
+ Employees request allocations to Time Off Officers (e.g. recuperation days).
+ </p>
+ </field>
+ </record>
+
+ <record id="ir_actions_server_approve_allocations" model="ir.actions.server">
+ <field name="name">Approve Allocations</field>
+ <field name="model_id" ref="hr_holidays.model_hr_leave_allocation"/>
+ <field name="binding_model_id" ref="hr_holidays.model_hr_leave_allocation"/>
+ <field name="binding_view_types">list</field>
+ <field name="state">code</field>
+ <field name="code">action = records.action_approve()</field>
+ </record>
+
+ <record id="hr_leave_allocation_view_form_dashboard" model="ir.ui.view">
+ <field name="name">hr.leave.view.form.dashboard</field>
+ <field name="model">hr.leave.allocation</field>
+ <field name="inherit_id" ref="hr_holidays.hr_leave_allocation_view_form"/>
+ <field name="mode">primary</field>
+ <field name="priority">100</field>
+ <field name="arch" type="xml">
+ <xpath expr="//header" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <div name="button_box" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </div>
+ </field>
+ </record>
+
+</odoo>
diff --git a/addons/hr_holidays/views/hr_leave_template.xml b/addons/hr_holidays/views/hr_leave_template.xml
new file mode 100644
index 00000000..cfdeeac2
--- /dev/null
+++ b/addons/hr_holidays/views/hr_leave_template.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <template id="assets_backend" inherit_id="web.assets_backend">
+ <xpath expr="script[last()]" position="after">
+ <script type="text/javascript" src="/hr_holidays/static/src/js/time_off_calendar.js"></script>
+ <script type="text/javascript" src="/hr_holidays/static/src/js/leave_stats_widget.js"></script>
+ <script type="text/javascript" src="/hr_holidays/static/src/bugfix/bugfix.js"/>
+ <script type="text/javascript" src="/hr_holidays/static/src/components/thread_view/thread_view.js"/>
+ </xpath>
+ <xpath expr="link[last()]" position="after">
+ <link rel="stylesheet" type="text/scss" href="/hr_holidays/static/scss/hr_leave_mobile.scss"/>
+ <link rel="stylesheet" type="text/scss" href="/hr_holidays/static/src/scss/time_off.scss"/>
+ <link rel="stylesheet" type="text/scss" href="/hr_holidays/static/src/bugfix/bugfix.scss"/>
+ <link rel="stylesheet" type="text/scss" href="/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon.scss"/>
+ <link rel="stylesheet" type="text/scss" href="/hr_holidays/static/src/components/thread_icon/thread_icon.scss"/>
+ <link rel="stylesheet" type="text/scss" href="/hr_holidays/static/src/components/thread_view/thread_view.scss"/>
+ </xpath>
+ </template>
+ <template id="qunit_suite" name="hr_holidays_qunit_suite" inherit_id="web.qunit_suite_tests">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/hr_holidays/static/src/bugfix/bugfix_tests.js"></script>
+ <script type="text/javascript" src="/hr_holidays/static/tests/helpers/mock_models.js"/>
+ <script type="text/javascript" src="/hr_holidays/static/tests/helpers/mock_server.js"/>
+ <script type="text/javascript" src="/hr_holidays/static/tests/test_leave_stats_widget.js"></script>
+ </xpath>
+ </template>
+</odoo>
diff --git a/addons/hr_holidays/views/hr_leave_type_views.xml b/addons/hr_holidays/views/hr_leave_type_views.xml
new file mode 100644
index 00000000..3d0364a3
--- /dev/null
+++ b/addons/hr_holidays/views/hr_leave_type_views.xml
@@ -0,0 +1,130 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<odoo>
+
+ <record id="view_holidays_status_filter" model="ir.ui.view">
+ <field name="name">hr.leave.type.filter</field>
+ <field name="model">hr.leave.type</field>
+ <field name="arch" type="xml">
+ <search string="Search Time Off Type">
+ <field name="name" string="Time Off Types"/>
+ <field name="code"/>
+ <field name="create_calendar_meeting"/>
+ <separator/>
+ <filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
+ </search>
+ </field>
+ </record>
+
+ <record id="edit_holiday_status_form" model="ir.ui.view">
+ <field name="name">hr.leave.type.form</field>
+ <field name="model">hr.leave.type</field>
+ <field name="arch" type="xml">
+ <form string="Time Off Type">
+ <sheet>
+ <div class="oe_button_box" name="button_box">
+ <button class="oe_stat_button" type="object" name="action_see_days_allocated" icon="fa-archive" attrs="{'invisible': [('allocation_type', '=', 'no')]}">
+ <div class="o_stat_info">
+ <field name="group_days_allocation"/>
+ <span class="o_stat_text">Group Days Allocated</span>
+ </div>
+ </button>
+ <button class="oe_stat_button" type="object" name="action_see_group_leaves" icon="fa-archive">
+ <div class="o_stat_info">
+ <field name="group_days_leave"/>
+ <span class="o_stat_text">Group Time Off</span>
+ </div>
+ </button>
+ </div>
+ <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
+ <div class="oe_title">
+ <h1><field name="name"/></h1>
+ </div>
+ <group>
+ <group name="description" string="Options">
+ <field name="active" invisible="1"/>
+ <field name="code" string="Payroll Code"/>
+ <field name="request_unit" widget="radio"/>
+ </group>
+ <group name="validity" string="Validity">
+ <field name="validity_start"/>
+ <field name="validity_stop"/>
+ </group>
+ <group name="allocation_validation" string="Allocation Requests">
+ <field name="allocation_type" widget="radio" force_save="1"/>
+ <field name="allocation_validation_type" string="Approval" widget="radio" attrs="{'invisible': [('allocation_type', '!=', 'fixed_allocation')]}"/>
+ <field name="responsible_id" domain="[('share', '=', False)]"
+ attrs="{
+ 'invisible': [('leave_validation_type', 'in', ['no_validation', 'manager']), '|', ('allocation_type', '=', 'no'), ('allocation_validation_type', '=', 'manager')],
+ 'required': ['|', ('leave_validation_type', 'in', ['hr', 'both']), '&amp;', ('allocation_type', 'in', ['fixed_allocation', 'fixed']), ('allocation_validation_type', 'in', ['hr', 'both'])]}"/>
+ </group>
+ <group name="leave_validation" string="Time Off Requests">
+ <field name="leave_validation_type" string="Approval" widget="radio"/>
+ </group>
+ <group name="notification" string="Notification" colspan="2" groups="base.group_no_one">
+ <group>
+ <field name="leave_notif_subtype_id"
+ domain="[('res_model','=','hr.leave')]"
+ context="{'default_name': name, 'default_res_model': 'hr.leave'}"/>
+ <field name="allocation_notif_subtype_id"
+ domain="[('res_model','=','hr.leave.allocation')]"
+ context="{'default_name': name, 'default_res_model': 'hr.leave.allocation'}"/>
+ </group>
+ </group>
+ <group name="calendar" string="Calendar" groups="base.group_no_one">
+ <field name="create_calendar_meeting"/>
+ <field name="color_name"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ </group>
+ </group>
+ </sheet>
+ </form>
+ </field>
+ </record>
+
+ <record id="hr_holiday_status_view_kanban" model="ir.ui.view">
+ <field name="name">hr.leave.type.kanban</field>
+ <field name="model">hr.leave.type</field>
+ <field name="arch" type="xml">
+ <kanban class="o_kanban_mobile">
+ <templates>
+ <t t-name="kanban-box">
+ <div t-attf-class="oe_kanban_global_click">
+ <div>
+ <strong><field name="name"/></strong>
+ </div>
+ <div>
+ <span>Max Time Off: <field name="max_leaves"/></span>
+ <span class="float-right">Time Off Taken: <field name="leaves_taken"/></span>
+ </div>
+ </div>
+ </t>
+ </templates>
+ </kanban>
+ </field>
+ </record>
+
+ <record id="view_holiday_status_normal_tree" model="ir.ui.view">
+ <field name="name">hr.leave.type.normal.tree</field>
+ <field name="model">hr.leave.type</field>
+ <field name="arch" type="xml">
+ <tree string="Time Off Type">
+ <field name="display_name"/>
+ <field name="code"/>
+ <field name="allocation_type"/>
+ <field name="leave_validation_type"/>
+ <field name="allocation_validation_type"/>
+ <field name="validity_start"/>
+ <field name="validity_stop"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="open_view_holiday_status" model="ir.actions.act_window">
+ <field name="name">Time Off Types</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">hr.leave.type</field>
+ <field name="view_mode">tree,kanban,form</field>
+ </record>
+
+</odoo>
diff --git a/addons/hr_holidays/views/hr_leave_views.xml b/addons/hr_holidays/views/hr_leave_views.xml
new file mode 100644
index 00000000..42fb80d3
--- /dev/null
+++ b/addons/hr_holidays/views/hr_leave_views.xml
@@ -0,0 +1,752 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<odoo>
+
+ <record model="ir.actions.server" id="action_report_to_payslip">
+ <field name="name">Report to Payslip</field>
+ <field name="model_id" ref="model_hr_leave"/>
+ <field name="binding_model_id" ref="model_hr_leave" />
+ <field name="state">code</field>
+ <field name="code">
+ if records:
+ records.write({'payslip_status': True})
+ </field>
+ </record>
+
+ <record model="ir.actions.server" id="action_manager_approval">
+ <field name="name">Manager Approval</field>
+ <field name="model_id" ref="model_hr_leave"/>
+ <field name="binding_model_id" ref="model_hr_leave" />
+ <field name="state">code</field>
+ <field name="code">
+ if records:
+ records.action_approve()
+ </field>
+ </record>
+ <record model="ir.actions.server" id="action_hr_approval">
+ <field name="name">HR Approval</field>
+ <field name="model_id" ref="model_hr_leave"/>
+ <field name="binding_model_id" ref="model_hr_leave" />
+ <field name="state">code</field>
+ <field name="code">
+ if records:
+ records.action_validate()
+ </field>
+ </record>
+
+ <record id="view_evaluation_report_graph" model="ir.ui.view">
+ <field name="name">hr.holidays.graph</field>
+ <field name="model">hr.leave</field>
+ <field name="arch" type="xml">
+ <graph string="Appraisal Analysis" stacked="True" sample="1">
+ <field name="employee_id" type="row"/>
+ <field name="holiday_status_id" type="row"/>
+ <field name="date_from" type="col"/>
+ <field name="number_of_days" type="measure"/>
+ </graph>
+ </field>
+ </record>
+
+ <record id="view_hr_holidays_filter" model="ir.ui.view">
+ <field name="name">hr.holidays.filter</field>
+ <field name="model">hr.leave</field>
+ <field name="arch" type="xml">
+ <search string="Search Time Off">
+ <field name="employee_id"/>
+ <field name="department_id" operator="child_of"/>
+ <field name="holiday_status_id"/>
+ <field name="name"/>
+ <filter domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="approve"/>
+ <filter domain="[('state', '=', 'validate1')]" string="Need Second Approval" name="second_approval"/>
+ <filter string="Approved Time Off" domain="[('state', '=', 'validate')]" name="validated"/>
+ <separator/>
+ <filter string="My Department Time Off" name="department" domain="['|', ('department_id.member_ids.user_id', '=', uid), ('employee_id.user_id', '=', uid)]" help="My Department Time Off"/>
+ <filter string="People I Manage" name="managed_people" domain="[('employee_id.leave_manager_id', '=', uid)]" help="Time off of people you are manager of"/>
+ <filter string="My Time Off" name="my_leaves" domain="[('employee_id.user_id', '=', uid)]"/>
+ <separator/>
+ <filter string="To Report in Payslip" name="gray" domain="[('payslip_status', '=', False)]" groups="hr_holidays.group_hr_holidays_user"/>
+ <separator/>
+ <filter name="filter_date_from" date="date_from"/>
+ <separator/>
+ <filter name="year" string="Active Time Off"
+ domain="[('holiday_status_id.active', '=', True)]" help="Active Time Off"/>
+ <filter invisible="1" string="Late Activities" name="activities_overdue"
+ domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
+ help="Show all records which has next action date is before today"/>
+ <filter invisible="1" string="Today Activities" name="activities_today"
+ domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
+ <filter invisible="1" string="Future Activities" name="activities_upcoming_all"
+ domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))
+ ]"/>
+ <group expand="0" string="Group By">
+ <filter name="group_employee" string="Employee" context="{'group_by':'employee_id'}"/>
+ <filter name="group_type" string="Type" context="{'group_by':'holiday_status_id'}"/>
+ <filter name="group_state" string="Status" context="{'group_by': 'state'}"/>
+ <separator/>
+ <filter name="group_date_from" string="Start Date" context="{'group_by':'date_from'}"/>
+ </group>
+ <searchpanel>
+ <field name="state" string="Status"/>
+ </searchpanel>
+ </search>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_kanban" model="ir.ui.view">
+ <field name="name">hr.leave.view.kanban</field>
+ <field name="model">hr.leave</field>
+ <field name="arch" type="xml">
+ <kanban class="o_kanban_mobile" create="0" sample="1">
+ <field name="employee_id"/>
+ <field name="date_from"/>
+ <field name="date_to"/>
+ <field name="name"/>
+ <field name="number_of_days"/>
+ <field name="can_approve"/>
+ <field name="holiday_status_id"/>
+ <field name="state"/>
+ <templates>
+ <t t-name="kanban-box">
+ <div class="oe_kanban_global_click container">
+ <div class="row no-gutters">
+ <div class="col-2">
+ <img t-att-src="kanban_image('hr.employee', 'image_128', record.employee_id.raw_value)"
+ t-att-title="record.employee_id.value"
+ t-att-alt="record.employee_id.value"
+ class="oe_kanban_avatar o_image_40_cover float-left mr4"/>
+ </div>
+ <div class="col-10">
+ <span class="badge badge-pill float-right mt4 mr16"><t t-esc="record.number_of_days.value"/> days</span>
+ <strong class="o_kanban_record_title"><t t-esc="record.employee_id.value"/></strong>
+ <div class="text-muted o_kanban_record_subtitle">
+ <t t-esc="record.holiday_status_id.value"/>
+ </div>
+ <div class="o_dropdown_kanban dropdown" groups="base.group_user">
+ <a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" href="#" aria-label="Dropdown menu" title="Dropdown menu">
+ <span class="fa fa-ellipsis-v"/>
+ </a>
+ <div class="dropdown-menu" role="menu">
+ <a t-if="widget.editable" role="menuitem" type="edit" class="dropdown-item">Edit Time Off</a>
+ <a t-if="widget.deletable" role="menuitem" type="delete" class="dropdown-item">Delete</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row no-gutters justify-content-end">
+ <div class="col-2"/>
+ <div class="col-10">
+ <span class="text-muted">from </span>
+ <field name="date_from" widget="date"/>
+ <span class="text-muted">to </span>
+ <field name="date_to" widget="date"/>
+ </div>
+ </div>
+ <div class="row no-gutters" t-if="['validate', 'refuse'].includes(record.state.raw_value)">
+ <div class="col-2"/>
+ <div class="col-10">
+ <span t-if="record.state.raw_value === 'validate'" class="fa fa-check text-muted" aria-label="validated"/>
+ <span t-else="" class="fa fa-ban text-muted" aria-label="refused"/>
+ <span class="text-muted"><t t-esc="record.state.value"/></span>
+ </div>
+ </div>
+ <div class="o_kanban_record_bottom" t-if="record.can_approve.raw_value">
+ <div class="oe_kanban_bottom_left">
+ <button t-if="record.state.raw_value === 'confirm'" name="action_approve" type="object" class="btn btn-primary btn-sm mt8">Approve</button>
+ <button t-if="record.state.raw_value === 'validate1'" name="action_validate" type="object" class="btn btn-primary btn-sm mt8" groups="hr_holidays.group_hr_holidays_manager">Validate</button>
+ <button t-if="['confirm', 'validate1'].includes(record.state.raw_value)" name="action_refuse" type="object" class="btn btn-secondary btn-sm mt8">Refuse</button>
+ </div>
+ </div>
+ </div>
+ </t>
+ </templates>
+ </kanban>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_activity" model="ir.ui.view">
+ <field name="name">hr.leave.view.activity</field>
+ <field name="model">hr.leave</field>
+ <field name="arch" type="xml">
+ <activity string="Time Off Request">
+ <field name="employee_id"/>
+ <field name="date_from"/>
+ <field name="date_to"/>
+ <field name="number_of_days"/>
+ <templates>
+ <div t-name="activity-box">
+ <img t-att-src="activity_image('hr.employee', 'image_128', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="50" height="50"/>
+ <div>
+ <field name="name"/>
+ <span class="ml-3 text-muted">
+ <field name="number_of_days"/> days
+ </span>
+ <div class="text-muted">
+ <div>From: <field name="date_from" widget="date"/></div>
+ <div>To: <field name="date_to" widget="date"/></div>
+ </div>
+ </div>
+ </div>
+ </templates>
+ </activity>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_form" model="ir.ui.view">
+ <field name="name">hr.leave.view.form</field>
+ <field name="model">hr.leave</field>
+ <field name="priority">32</field>
+ <field name="arch" type="xml">
+ <form string="Time Off Request">
+ <field name="can_reset" invisible="1"/>
+ <field name="can_approve" invisible="1"/>
+ <header>
+ <button string="Confirm" name="action_confirm" states="draft" type="object" class="oe_highlight"/>
+ <button string="Approve" name="action_approve" type="object" class="oe_highlight" attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', '!=', 'confirm')]}"/>
+ <button string="Validate" name="action_validate" states="validate1" type="object" groups="hr_holidays.group_hr_holidays_manager" class="oe_highlight"/>
+ <button string="Refuse" name="action_refuse" type="object" attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', 'not in', ('confirm','validate1','validate'))]}"/>
+ <button string="Mark as Draft" name="action_draft" type="object"
+ attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
+ <field name="state" widget="statusbar" statusbar_visible="confirm,validate"/>
+ </header>
+ <sheet>
+ <div class="alert alert-info" role="alert" attrs="{'invisible': ['|', ('tz_mismatch', '=', False), ('holiday_type', '=', 'category')]}">
+ <span attrs="{'invisible': [('holiday_type', '!=', 'employee')]}">
+ The employee has a different timezone than yours! Here dates and times are displayed in the employee's timezone
+ </span>
+ <span attrs="{'invisible': [('holiday_type', '!=', 'department')]}">
+ The department's company has a different timezone than yours! Here dates and times are displayed in the company's timezone
+ </span>
+ <span attrs="{'invisible': [('holiday_type', '!=', 'company')]}">
+ The company has a different timezone than yours! Here dates and times are displayed in the company's timezone
+ </span>
+ (<field name="tz"/>).
+ </div>
+ <field name="tz_mismatch" invisible="1"/>
+ <field name="holiday_type" invisible="1"/>
+ <field name="leave_type_request_unit" invisible="1"/>
+ <div class="oe_title" name="title">
+ <field name="display_name" invisible="1"/>
+ <h1>
+ <field name="employee_id" nolabel="1" readonly="1" force_save="1" invisible="1"/>
+ </h1>
+ <h2>
+ <field name="holiday_status_id" nolabel="1" domain="['&amp;', ('virtual_remaining_leaves', '&gt;', 0), '|', ('allocation_type', 'in', ['fixed_allocation', 'no']),'&amp;',('allocation_type', '=', 'fixed'), ('max_leaves', '>', '0')]" context="{'employee_id':employee_id, 'default_date_from':date_from}" options="{'no_create': True, 'no_open': True}" class="w-100"/>
+ </h2>
+ </div>
+ <group>
+ <group>
+
+ <label for="request_date_from" string="Dates"/>
+ <div>
+ <field name="date_from" invisible="1"/>
+ <field name="date_to" invisible="1"/>
+ <div class="o_row o_row_readonly o_hr_holidays_dates">
+ <span class="oe_inline"
+ attrs="{'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)]}">
+ From
+ </span>
+ <field name="request_date_from" class="oe_inline" nolabel="1"
+ attrs="{'readonly': [('state', 'not in', ('draft', 'confirm'))],
+ 'required': ['|', ('date_from', '=', False), ('date_to', '=', False)]
+ }"/>
+ <span class="oe_inline"
+ attrs="{'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)]}">
+ To
+ </span>
+ <field name="request_date_to" class="oe_inline"
+ attrs="{
+ 'readonly': [('state', 'not in', ('draft', 'confirm'))],
+ 'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)],
+ 'required': ['|', ('date_from', '=', False), ('date_to', '=', False)]
+ }"/>
+ <field name="request_date_from_period" class="oe_inline"
+ string="In"
+ options="{'horizontal': True}"
+ attrs="{
+ 'readonly': [('state', 'not in', ('draft', 'confirm'))],
+ 'required': [('request_unit_half', '=', True)],
+ 'invisible': [('request_unit_half', '=', False)]}"/>
+ </div>
+ <div class="o_row o_row_readonly oe_edit_only" style="margin-left: -2px;">
+ <field name="request_unit_half" attrs="{
+ 'readonly': [('state', 'not in', ('draft', 'confirm'))],
+ 'invisible': [('leave_type_request_unit', '=', 'day')]
+ }"/>
+ <label for="request_unit_half" attrs="{
+ 'readonly': [('state', 'not in', ('draft', 'confirm'))],
+ 'invisible': [('leave_type_request_unit', '=', 'day')]
+ }"/>
+ <field name="request_unit_hours" attrs="{
+ 'readonly': [('state', 'not in', ('draft', 'confirm'))],
+ 'invisible': [('leave_type_request_unit', '!=', 'hour')]
+ }" class="ml-5"/>
+ <label for="request_unit_hours" attrs="{
+ 'readonly': [('state', 'not in', ('draft', 'confirm'))],
+ 'invisible': [('leave_type_request_unit', '!=', 'hour')]
+ }"/>
+ <field name="request_unit_custom" invisible="1" attrs="{
+ 'readonly': [('state', 'not in', ('draft', 'confirm'))],
+ }"/>
+ <label for="request_unit_custom" invisible="1" attrs="{
+ 'readonly': [('state', 'not in', ('draft', 'confirm'))],
+ }"/>
+ </div>
+ <div class="o_row o_row_readonly">
+ <label for="request_hour_from" string="From"
+ attrs="{'invisible': [('request_unit_hours', '=', False)]}"/>
+ <field name="request_hour_from"
+ attrs="{
+ 'readonly': [('state', '=', 'validate')],
+ 'required': [('request_unit_hours', '=', True)],
+ 'invisible': [('request_unit_hours', '=', False)]}"/>
+ <label for="request_hour_to" string="To"
+ attrs="{'invisible': [('request_unit_hours', '=', False)]}"/>
+ <field name="request_hour_to"
+ attrs="{
+ 'readonly': [('state', '=', 'validate')],
+ 'required': [('request_unit_hours', '=', True)],
+ 'invisible': [('request_unit_hours', '=', False)]}"/>
+ </div>
+ </div>
+
+ <!-- When the user is leave manager, he should always see `number_of_days` to allow
+ him to edit the value. `number_of_hours_display` is only an informative field -->
+ <label for="number_of_days" string="Duration" attrs="{'invisible': [('request_unit_half', '=', True), ('leave_type_request_unit', '!=', 'hour')]}"/>
+ <div>
+ <div class="o_row">
+ <div groups="!hr_holidays.group_hr_holidays_manager" attrs="{'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)]}" class="o_row">
+ <field name="number_of_days_display" nolabel="1" readonly="1" class="oe_inline"/>
+ <span>Days</span>
+ </div>
+ <div groups="hr_holidays.group_hr_holidays_manager" class="o_row" attrs="{'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)]}">
+ <field name="number_of_days" nolabel="1" class="oe_inline"/>
+ <span>Days</span>
+ </div>
+ <div attrs="{'invisible': [('leave_type_request_unit', '!=', 'hour')]}" class="o_row">
+ <field name="number_of_hours_text" nolabel="1" class="oe_inline"/>
+ </div>
+ </div>
+ </div>
+ <field name="name" attrs="{'readonly': [('state', 'not in', ('draft', 'confirm'))]}" widget="text"/>
+ <field name="user_id" invisible="1"/>
+ </group>
+ <group name="col_right">
+ <field name="department_id" groups="hr_holidays.group_hr_holidays_user" invisible="1"/>
+ </group>
+ </group>
+ </sheet>
+ <div class="oe_chatter">
+ <field name="message_follower_ids"/>
+ <field name="activity_ids"/>
+ <field name="message_ids"/>
+ </div>
+ </form>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_form_dashboard" model="ir.ui.view">
+ <field name="name">hr.leave.view.form.dashboard</field>
+ <field name="model">hr.leave</field>
+ <field name="inherit_id" ref="hr_holidays.hr_leave_view_form"/>
+ <field name="mode">primary</field>
+ <field name="priority">100</field>
+ <field name="arch" type="xml">
+ <xpath expr="//header" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_dashboard" model="ir.ui.view">
+ <field name="name">hr.leave.view.dashboard</field>
+ <field name="model">hr.leave</field>
+ <field name="arch" type="xml">
+ <calendar js_class="time_off_calendar" string="Time Off Request" form_view_id="%(hr_holidays.hr_leave_view_form_dashboard)d" event_open_popup="true" date_start="date_from" date_stop="date_to" mode="month" quick_add="False" show_unusual_days="True" color="holiday_status_id" hide_time="True">
+ <field name="display_name"/>
+ <field name="holiday_status_id" filters="1" invisible="1"/>
+ <field name="state" invisible="1"/>
+ </calendar>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_form_dashboard_new_time_off" model="ir.ui.view">
+ <field name="name">hr.leave.view.form.dashboard.new.time.off</field>
+ <field name="model">hr.leave</field>
+ <field name="inherit_id" ref="hr_holidays.hr_leave_view_form_dashboard"/>
+ <field name="mode">primary</field>
+ <field name="priority">17</field>
+ <field name="arch" type="xml">
+ <xpath expr="//sheet" position="after">
+ <footer>
+ <button string="Save" special="save" class="oe_highlight" />
+ <button string="Discard" special="cancel" />
+ </footer>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_form_manager" model="ir.ui.view">
+ <field name="name">hr.leave.view.form.manager</field>
+ <field name="model">hr.leave</field>
+ <field name="inherit_id" ref="hr_leave_view_form"/>
+ <field name="mode">primary</field>
+ <field name="priority">16</field>
+ <field name="arch" type="xml">
+ <div name="title" position="replace">
+ <field name="display_name" invisible="1"/>
+ <div class="oe_title" name="title">
+ <h2>
+ <field name="holiday_status_id" nolabel="1"/>
+ </h2>
+ </div>
+ </div>
+ <field name="name" position="replace"/>
+ <field name="user_id" position="before">
+ <field name="name"/>
+ </field>
+ <xpath expr="//group[@name='col_right']" position="replace">
+ <group>
+ <field name="holiday_type" string="Mode"
+ groups="hr_holidays.group_hr_holidays_user"/>
+ <field name="employee_id" groups="hr_holidays.group_hr_holidays_user" attrs="{
+ 'required': [('holiday_type', '=', 'employee')],
+ 'invisible': [('holiday_type', '!=', 'employee')]
+ }"/>
+ <field name="mode_company_id" string="Company" groups="hr_holidays.group_hr_holidays_user" attrs="{
+ 'required': [('holiday_type', '=', 'company')],
+ 'invisible': [('holiday_type', '!=', 'company')]
+ }"/>
+ <field name="category_id" groups="hr_holidays.group_hr_holidays_user" attrs="{
+ 'required': [('holiday_type', '=', 'category')],
+ 'invisible': [('holiday_type', '!=','category')]
+ }"/>
+ <field name="department_id" groups="hr_holidays.group_hr_holidays_user" attrs="{
+ 'required': [('holiday_type', '=', 'department')],
+ 'invisible': [('holiday_type', 'not in', ('employee', 'department'))]
+ }"/>
+ <field name="payslip_status" groups="hr_holidays.group_hr_holidays_user" widget="toggle_button"/>
+ </group>
+ <group groups="hr_holidays.group_hr_holidays_manager" string="Manager's Comment">
+ <field name="report_note" placeholder="e.g. Report to the next month..." nolabel="1"/>
+ </group>
+ <group>
+ <widget name="hr_leave_stats"/>
+ </group>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_calendar" model="ir.ui.view">
+ <field name="name">hr.leave.view.calendar</field>
+ <field name="model">hr.leave</field>
+ <field name="arch" type="xml">
+ <calendar js_class="time_off_calendar_all" string="Time Off Request" event_open_popup="true" date_start="date_from" date_stop="date_to" mode="month" quick_add="False" color="employee_id">
+ <field name="display_name"/>
+ <field name="holiday_status_id" filters="1" invisible="1"/>
+ <field name="employee_id" filters="1" invisible="1"/>
+ </calendar>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_tree" model="ir.ui.view">
+ <field name="name">hr.holidays.view.tree</field>
+ <field name="model">hr.leave</field>
+ <field name="arch" type="xml">
+ <tree string="Time Off Requests" sample="1">
+ <field name="employee_id" widget="many2one_avatar_employee"/>
+ <field name="department_id" optional="hidden"/>
+ <field name="holiday_type" string="Mode" groups="base.group_no_one"/>
+ <field name="holiday_status_id" class="font-weight-bold"/>
+ <field name="name"/>
+ <field name="date_from"/>
+ <field name="date_to"/>
+ <field name="duration_display" string="Duration"/>
+ <field name="payslip_status" widget="toggle_button" options='{"active": "Reported in last payslips", "inactive": "To Report in Payslip"}' groups="hr_holidays.group_hr_holidays_user" nolabel="1"/>
+ <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state in ('confirm','validate1')" decoration-success="state == 'validate'"/>
+ <field name="category_id" invisible="1"/>
+ <field name="user_id" invisible="1"/>
+ <field name="message_needaction" invisible="1"/>
+ <button string="Approve" name="action_approve" type="object"
+ icon="fa-thumbs-up"
+ states="confirm"
+ groups="hr_holidays.group_hr_holidays_responsible"/>
+ <button string="Validate" name="action_validate" type="object"
+ icon="fa-check"
+ states="validate1"
+ groups="hr_holidays.group_hr_holidays_manager"/>
+ <button string="Refuse" name="action_refuse" type="object"
+ icon="fa-times"
+ states="confirm,validate1"
+ groups="hr_holidays.group_hr_holidays_manager"/>
+ <field name="activity_exception_decoration" widget="activity_exception"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_tree_my" model="ir.ui.view">
+ <field name="name">hr.holidays.view.tree</field>
+ <field name="model">hr.leave</field>
+ <field name="inherit_id" ref="hr_leave_view_tree"/>
+ <field name="mode">primary</field>
+ <field name="priority">32</field>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='employee_id']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//field[@name='department_id']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//field[@name='holiday_type']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//field[@name='payslip_status']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//button[@name='action_approve']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//button[@name='action_validate']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//button[@name='action_refuse']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_search_my" model="ir.ui.view">
+ <field name="name">hr.holidays.view.search.my</field>
+ <field name="model">hr.leave</field>
+ <field name="inherit_id" ref="view_hr_holidays_filter"/>
+ <field name="mode">primary</field>
+ <field name="priority">32</field>
+ <field name="arch" type="xml">
+ <xpath expr="//searchpanel" position="replace"/>
+ <xpath expr="//filter[@name='department']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='managed_people']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='my_leaves']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='gray']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='group_employee']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_view_search_manager" model="ir.ui.view">
+ <field name="name">hr.holidays.view.search.manager</field>
+ <field name="model">hr.leave</field>
+ <field name="inherit_id" ref="view_hr_holidays_filter"/>
+ <field name="mode">primary</field>
+ <field name="priority">33</field>
+ <field name="arch" type="xml">
+ <xpath expr="//filter[@name='my_leaves']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='gray']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ <xpath expr="//filter[@name='group_employee']" position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_leave_action_new_request" model="ir.actions.act_window">
+ <field name="name">Dashboard</field>
+ <field name="res_model">hr.leave</field>
+ <field name="view_mode">calendar,tree,form,activity</field>
+ <field name="domain">[('user_id', '=', uid)]</field>
+ <field name="context">{'short_name': 1}</field>
+ <field name="search_view_id" ref="hr_holidays.hr_leave_view_search_my"/>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Keep track of your PTOs.
+ </p><p>
+ A great way to keep track on your time off requests, sick days, and approval status.
+ </p>
+ </field>
+ </record>
+
+ <record id="hr_leave_action_new_request_view_calendar" model="ir.actions.act_window.view">
+ <field name="sequence">1</field>
+ <field name="view_mode">calendar</field>
+ <field name="act_window_id" ref="hr_leave_action_new_request"/>
+ <field name="view_id" ref="hr_leave_view_dashboard"/>
+ </record>
+
+ <record id="hr_leave_action_new_request_view_tree" model="ir.actions.act_window.view">
+ <field name="sequence">2</field>
+ <field name="view_mode">tree</field>
+ <field name="act_window_id" ref="hr_leave_action_new_request"/>
+ <field name="view_id" ref="hr_leave_view_tree_my"/>
+ </record>
+
+ <record id="hr_leave_action_new_request_view_form" model="ir.actions.act_window.view">
+ <field name="sequence">3</field>
+ <field name="view_mode">form</field>
+ <field name="act_window_id" ref="hr_leave_action_new_request"/>
+ <field name="view_id" ref="hr_leave_view_form"/>
+ </record>
+
+ <record id="hr_leave_action_my_request" model="ir.actions.act_window">
+ <field name="name">Time Off Requests</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">hr.leave</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+ <record id="hr_leave_action_my_request_view_form" model="ir.actions.act_window.view">
+ <field name="view_mode">form</field>
+ <field name="act_window_id" ref="hr_leave_action_my_request"/>
+ <field name="view_id" ref="hr_leave_view_form_dashboard_new_time_off"/>
+ </record>
+
+ <record id="hr_leave_action_my" model="ir.actions.act_window">
+ <field name="name">My Time Off Requests</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">hr.leave</field>
+ <field name="view_mode">tree,form,calendar,kanban,activity</field>
+ <field name="context">{}</field>
+ <field name="search_view_id" ref="hr_leave_view_search_my"/>
+ <field name="domain">[('user_id', '=', uid)]</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Keep track of your PTOs.
+ </p><p>
+ A great way to keep track on your time off requests, sick days, and approval status.
+ </p>
+ </field>
+ </record>
+
+ <record id="hr_leave_action_my_view_tree" model="ir.actions.act_window.view">
+ <field name="sequence">1</field>
+ <field name="view_mode">tree</field>
+ <field name="act_window_id" ref="hr_leave_action_my"/>
+ <field name="view_id" ref="hr_leave_view_tree_my"/>
+ </record>
+
+ <record id="hr_leave_action_my_view_form" model="ir.actions.act_window.view">
+ <field name="sequence">2</field>
+ <field name="view_mode">form</field>
+ <field name="act_window_id" ref="hr_leave_action_my"/>
+ <field name="view_id" ref="hr_leave_view_form"/>
+ </record>
+
+ <record id="hr_leave_action_action_approve_department" model="ir.actions.act_window">
+ <field name="name">All Time Off</field>
+ <field name="res_model">hr.leave</field>
+ <field name="view_mode">tree,kanban,form,calendar,activity</field>
+ <field name="search_view_id" ref="hr_holidays.hr_leave_view_search_manager"/>
+ <field name="context">{
+ 'search_default_managed_people': 1,
+ 'hide_employee_name': 1}
+ </field>
+ <field name="domain">[]</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Meet the time off dashboard.
+ </p><p>
+ A great way to keep track on employee’s PTOs, sick days, and approval status.
+ </p>
+ </field>
+ </record>
+
+ <record id="action_view_tree_manager_approve" model="ir.actions.act_window.view">
+ <field name="sequence" eval="1"/>
+ <field name="view_mode">tree</field>
+ <field name="view_id" ref="hr_leave_view_tree"/>
+ <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
+ </record>
+ <record id="action_view_kanban_manager_approve" model="ir.actions.act_window.view">
+ <field name="sequence" eval="2"/>
+ <field name="view_mode">kanban</field>
+ <field name="view_id" ref="hr_leave_view_kanban"/>
+ <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
+ </record>
+ <record id="action_view_form_manager_approve" model="ir.actions.act_window.view">
+ <field name="sequence" eval="3"/>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="hr_leave_view_form_manager"/>
+ <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
+ </record>
+ <record id="action_view_calendar_manager_approve" model="ir.actions.act_window.view">
+ <field name="sequence" eval="4"/>
+ <field name="view_mode">calendar</field>
+ <field name="view_id" eval="False"/>
+ <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
+ </record>
+ <record id="action_view_activity_manager_approve" model="ir.actions.act_window.view">
+ <field name="sequence" eval="5"/>
+ <field name="view_mode">activity</field>
+ <field name="view_id" eval="False"/>
+ <field name="act_window_id" ref="hr_leave_action_action_approve_department"/>
+ </record>
+
+ <record id="hr_leave_action_action_department" model="ir.actions.act_window">
+ <field name="name">Time Off Analysis</field>
+ <field name="res_model">hr.leave</field>
+ <field name="view_mode">graph,pivot</field>
+ <field name="context">{
+ 'search_default_department_id': [active_id],
+ 'default_department_id': active_id}
+ </field>
+ <field name="domain">[('holiday_type','=','employee')]</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ No data yet!
+ </p>
+ </field>
+ </record>
+
+ <record id="view_holiday_pivot" model="ir.ui.view">
+ <field name="name">hr.holidays.report_pivot</field>
+ <field name="model">hr.leave</field>
+ <field name="priority">20</field>
+ <field name="arch" type="xml">
+ <pivot string="Time Off Summary" sample="1">
+ <field name="employee_id" type="row"/>
+ <field name="date_from" type="col"/>
+ <field name="number_of_days" type="measure"/>
+ </pivot>
+ </field>
+ </record>
+
+ <record id="view_holiday_graph" model="ir.ui.view">
+ <field name="name">hr.holidays.report_graph</field>
+ <field name="model">hr.leave</field>
+ <field name="priority">20</field>
+ <field name="arch" type="xml">
+ <graph string="Time Off Summary" sample="1">
+ <field name="employee_id"/>
+ <field name="number_of_days" type="measure"/>
+ </graph>
+ </field>
+ </record>
+
+ <record id="action_hr_available_holidays_report" model="ir.actions.act_window">
+ <field name="name">Time Off Analysis</field>
+ <field name="res_model">hr.leave</field>
+ <field name="view_mode">graph,pivot,calendar,form</field>
+ <field name="context">{'search_default_year': 1, 'search_default_group_employee': 1, 'search_default_group_type': 1}</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ No data yet!
+ </p>
+ </field>
+ </record>
+
+ <record id="action_window_leave_graph" model="ir.actions.act_window.view">
+ <field name="sequence" eval="1"/>
+ <field name="view_mode">graph</field>
+ <field name="view_id" ref="view_holiday_graph"/>
+ <field name="act_window_id" ref="action_hr_available_holidays_report"/>
+ </record>
+
+</odoo>
diff --git a/addons/hr_holidays/views/hr_views.xml b/addons/hr_holidays/views/hr_views.xml
new file mode 100644
index 00000000..dbaf7d13
--- /dev/null
+++ b/addons/hr_holidays/views/hr_views.xml
@@ -0,0 +1,322 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<odoo>
+
+ <record id="hr_employee_action_from_department" model="ir.actions.act_window">
+ <field name="name">Absent Employees</field>
+ <field name="res_model">hr.employee</field>
+ <field name="view_mode">kanban,tree,form</field>
+ <field name="context">{
+ 'search_default_is_absent': 1,
+ 'search_default_department_id': [active_id],
+ 'default_department_id': active_id}
+ </field>
+ <field name="search_view_id" ref="hr.view_employee_filter"/>
+ </record>
+
+ <!--Hr Department Inherit Kanban view-->
+ <record id="hr_department_view_kanban" model="ir.ui.view">
+ <field name="name">hr.department.kanban.inherit</field>
+ <field name="model">hr.department</field>
+ <field name="inherit_id" ref="hr.hr_department_view_kanban"/>
+ <field name="groups_id" eval="[(4,ref('hr_holidays.group_hr_holidays_user'))]"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//templates" position="before">
+ <field name="leave_to_approve_count"/>
+ <field name="allocation_to_approve_count"/>
+ <field name="total_employee"/>
+ <field name="absence_of_today"/>
+ </xpath>
+
+ <xpath expr="//div[hasclass('o_kanban_primary_right')]" position="inside">
+ <div t-if="record.leave_to_approve_count.raw_value > 0" class="row ml16">
+ <div class="col-9">
+ <a name="%(hr_leave_action_action_approve_department)d" type="action">
+ Time Off Requests
+ </a>
+ </div>
+ <div class="col-3 text-right">
+ <field name="leave_to_approve_count"/>
+ </div>
+ </div>
+ <div t-if="record.allocation_to_approve_count.raw_value > 0" class="row ml16">
+ <div class="col-9">
+ <a name="%(hr_leave_allocation_action_approve_department)d" type="action">
+ Allocation Requests
+ </a>
+ </div>
+ <div class="col-3 text-right">
+ <field name="allocation_to_approve_count"/>
+ </div>
+ </div>
+ </xpath>
+
+ <xpath expr="//div[hasclass('o_kanban_card_upper_content')]" position="after">
+ <div class="row o_kanban_primary_bottom bottom_block">
+ <div class="col-3">
+ <a name="%(hr_employee_action_from_department)d" type="action" title="Absent Employee(s), Whose time off requests are either confirmed or validated on today">Absence</a>
+ </div>
+ <div class="col-9">
+ <field name="absence_of_today" widget="progressbar" options="{'current_value': 'absence_of_today', 'max_value': 'total_employee', 'editable': false}"/>
+ </div>
+ </div>
+ </xpath>
+
+ <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside">
+ <a role="menuitem" class="dropdown-item" name="%(hr_leave_action_action_department)d" type="action">
+ Time Off
+ </a>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <!--Hr Employee inherit search view-->
+ <record id="hr_employee_view_search" model="ir.ui.view">
+ <field name="name">hr.employee.search.view.inherit</field>
+ <field name="model">hr.employee</field>
+ <field name="inherit_id" ref="hr.view_employee_filter"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='job_id']" position="after">
+ <filter name="is_absent" string="Absent Today" domain="[('is_absent', '=', True)]"/>
+ </xpath>
+ </field>
+ </record>
+
+ <!-- hr_employee_public_view_kanban -->
+ <record id="hr_kanban_view_public_employees_kanban" model="ir.ui.view">
+ <field name="name">hr.employee.public.kanban.leaves.status</field>
+ <field name="model">hr.employee.public</field>
+ <field name="inherit_id" ref="hr.hr_employee_public_view_kanban"/>
+ <field name="arch" type="xml">
+ <xpath expr="//templates" position="before">
+ <field name="is_absent"/>
+ </xpath>
+ <xpath expr="//strong[hasclass('o_kanban_record_title')]" position="inside">
+ <!-- Employee is absent, in holiday but he is connected -->
+ <div class="float-right"
+ t-if="record.hr_icon_display.raw_value == 'presence_holiday_present'">
+ <span class="fa fa-plane text-success" role="img" aria-label="Present but on leave"
+ title="Present but on leave" name="presence_absent_active">
+ </span>
+ </div>
+ <!-- Employee is on holiday, not present and not connected -->
+ <div class="float-right"
+ t-if="record.hr_icon_display.raw_value == 'presence_holiday_absent'"
+ name="presence_absent">
+ <span class="fa fa-plane text-warning" role="img" aria-label="To define" title="On Leave"/>
+ </div>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_kanban_view_employees_kanban" model="ir.ui.view">
+ <field name="name">hr.employee.kanban.leaves.status</field>
+ <field name="model">hr.employee</field>
+ <field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
+ <field name="arch" type="xml">
+ <xpath expr="//templates" position="before">
+ <field name="current_leave_id"/>
+ <field name="current_leave_state"/>
+ <field name="leave_date_from"/>
+ <field name="leave_date_to"/>
+ <field name="is_absent"/>
+ </xpath>
+ <xpath expr="//div[@name='presence_absent_active']" position="after">
+ <!-- Employee is absent, in holiday but he is connected -->
+ <!-- green plane -->
+ <div class="float-right"
+ t-if="record.hr_icon_display.raw_value == 'presence_holiday_present'">
+ <span class="fa fa-plane text-success" role="img" aria-label="Present but on leave"
+ title="Present but on leave" name="presence_absent_active">
+ </span>
+ </div>
+ <!-- Employee is on holiday, not present and not connected -->
+ <!-- orange plane -->
+ <div class="float-right"
+ t-if="record.hr_icon_display.raw_value == 'presence_holiday_absent'"
+ name="presence_absent">
+ <span class="fa fa-plane text-warning" role="img" aria-label="To define" title="On Leave"/>
+ </div>
+ </xpath>
+ <xpath expr="//li[@id='last_login']" position="inside">
+ <span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
+ t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
+ t-att-title="moment(record.leave_date_from.raw_value).format('ddd Do MMM') + ' - ' + moment(record.leave_date_to.raw_value).format('ddd Do MMM')">
+ <field name="current_leave_id"/>
+ </span>
+ </xpath>
+ </field>
+ </record>
+
+ <!-- Hr employee inherit Legal Leaves -->
+ <record id="view_employee_form_leave_inherit" model="ir.ui.view">
+ <field name="name">hr.employee.leave.form.inherit</field>
+ <field name="model">hr.employee</field>
+ <field name="inherit_id" ref="hr.view_employee_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//button[@id='hr_presence_button']" position="attributes">
+ <attribute name="attrs">
+ {'invisible': ['|', '|', '|', ('last_activity', '=', False), ('is_absent', '=', True), ('user_id', '=', False), ('id', '=', False)]}
+ </attribute>
+ </xpath>
+ <xpath expr="//group[@name='managers']" position="inside">
+ <field name="leave_manager_id"/>
+ </xpath>
+ <xpath expr="//group[@name='managers']" position="attributes">
+ <attribute name="invisible">0</attribute>
+ </xpath>
+ <div name="button_box" position="inside">
+ <field name="current_leave_id" invisible="1"/>
+ <field name="show_leaves" invisible="1"/>
+ <field name="is_absent" invisible="1"/>
+ <field name="hr_icon_display" invisible="1"/>
+ <button disabled="1"
+ class="oe_stat_button"
+ context="{'search_default_employee_id': active_id}"
+ attrs="{'invisible': [('is_absent', '=', False)]}">
+ <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}"
+ role="img" class="fa fa-fw fa-plane o_button_icon text-success" aria-label="Off Till" title="Off Till"/>
+ <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}" role="img"
+ class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till" title="Off Till"/>
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_value">
+ <field name="leave_date_to"/>
+ </span>
+ <span class="o_stat_text">
+ Off Till
+ </span>
+ </div>
+ </button>
+ <button name="%(act_hr_employee_holiday_request)d"
+ type="action"
+ class="oe_stat_button"
+ icon="fa-calendar"
+ attrs="{'invisible': [('show_leaves','=', False)]}"
+ context="{'search_default_employee_id': active_id}"
+ groups="base.group_user"
+ help="Remaining leaves">
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_value">
+ <field name="allocation_used_display"/>/<field name="allocation_display"/> Days
+ </span>
+ <span class="o_stat_text">
+ Time Off
+ </span>
+ </div>
+ </button>
+ </div>
+ </field>
+ </record>
+
+ <record id="view_employee_tree_inherit_leave" model="ir.ui.view">
+ <field name="name">hr.employee.tree.leave</field>
+ <field name="model">hr.employee</field>
+ <field name="inherit_id" ref="hr.view_employee_tree"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='work_location']" position="after">
+ <field name="leave_manager_id" optional="hide" string="Time Off Approver"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="hr_employee_public_form_view_inherit" model="ir.ui.view">
+ <field name="name">hr.employee.public.leave.form.inherit</field>
+ <field name="model">hr.employee.public</field>
+ <field name="inherit_id" ref="hr.hr_employee_public_view_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='coach_id']" position="after">
+ <field name="leave_manager_id"/>
+ </xpath>
+ <xpath expr="//div[@name='button_box']" position="inside">
+ <field name="current_leave_id" invisible="1"/>
+ <field name="show_leaves" invisible="1"/>
+ <field name="is_absent" invisible="1"/>
+ <field name="hr_icon_display" invisible="1"/>
+ <button disabled="1"
+ class="oe_stat_button"
+ attrs="{'invisible': [('is_absent', '=', False)]}">
+ <div role="img" attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}"
+ class="fa fa-fw fa-plane o_button_icon text-success" aria-label="Off Till" title="Off Till"/>
+ <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}" role="img"
+ class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till" title="Off Till"/>
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_value">
+ <field name="leave_date_to"/>
+ </span>
+ <span class="o_stat_text">
+ Off Till
+ </span>
+ <t t-esc="hr_icon_display == 'presence_holiday_present'"/>
+ </div>
+ </button>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="res_users_view_form" model="ir.ui.view">
+ <field name="name">hr.user.preferences.view.form.leave.inherit</field>
+ <field name="model">res.users</field>
+ <field name="inherit_id" ref="hr.res_users_view_form_profile"/>
+ <field name="arch" type="xml">
+ <xpath expr="//header" position="inside">
+ <button name="%(hr_leave_action_new_request)d"
+ string="Request Time off"
+ type="action"
+ class="btn btn-primary"/>
+ <button name="%(hr_leave_allocation_action_my)d"
+ string="Request Allocation"
+ type="action"
+ class="btn btn-primary"/>
+ </xpath>
+ <xpath expr="//group[@name='managers']" position="inside">
+ <field name="leave_manager_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
+ </xpath>
+ <xpath expr="//group[@name='managers']" position="attributes">
+ <attribute name="invisible">0</attribute>
+ </xpath>
+ <xpath expr="//div[@name='button_box']" position="inside">
+ <field name="show_leaves" invisible="1"/>
+ <field name="employee_ids" invisible="1"/>
+ <field name="is_absent" invisible="1"/>
+ <field name="hr_icon_display" invisible="1"/>
+ <button name="%(hr_leave_action_new_request)d" type="action"
+ class="oe_stat_button"
+ invisible="context.get('from_my_profile', False)"
+ attrs="{'invisible': [('is_absent', '=', False)]}">
+ <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}"
+ role="img" class="fa fa-fw fa-plane o_button_icon text-success" aria-label="Off Till"
+ title="Off Till"/>
+ <div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}"
+ role="img" class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till"
+ title="Off Till"/>
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_value">
+ <field name="leave_date_to"/>
+ </span>
+ <span class="o_stat_text">
+ Off Till
+ </span>
+ </div>
+ </button>
+ <button name="%(hr_leave_action_new_request)d"
+ type="action"
+ class="oe_stat_button"
+ icon="fa-calendar"
+ attrs="{'invisible': [('show_leaves','=', False)]}"
+ groups="base.group_user"
+ help="Remaining leaves">
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_value">
+ <field name="allocation_used_display"/>/<field name="allocation_display"/> Days
+ </span>
+ <span class="o_stat_text">
+ Time Off
+ </span>
+ </div>
+ </button>
+ </xpath>
+ </field>
+ </record>
+
+</odoo>
diff --git a/addons/hr_holidays/views/mail_activity_views.xml b/addons/hr_holidays/views/mail_activity_views.xml
new file mode 100644
index 00000000..5502e95f
--- /dev/null
+++ b/addons/hr_holidays/views/mail_activity_views.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<odoo>
+ <!-- Activity types config -->
+ <record id="mail_activity_type_action_config_hr_holidays" model="ir.actions.act_window">
+ <field name="name">Activity Types</field>
+ <field name="res_model">mail.activity.type</field>
+ <field name="view_mode">tree,form</field>
+ <field name="domain">['|', ('res_model_id', '=', False), ('res_model_id.model', 'in', ['hr.leave', 'hr.leave.allocation'])]</field>
+ <field name="context">{'default_res_model': 'hr.leave'}</field>
+ </record>
+</odoo>
diff --git a/addons/hr_holidays/views/resource_views.xml b/addons/hr_holidays/views/resource_views.xml
new file mode 100644
index 00000000..f6577480
--- /dev/null
+++ b/addons/hr_holidays/views/resource_views.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<odoo>
+ <!-- Holiday on resource leave -->
+ <record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
+ <field name="name">resource.calendar.leaves.form.inherit</field>
+ <field name="model">resource.calendar.leaves</field>
+ <field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
+ <field name="arch" type="xml">
+ <field name="name" position="after">
+ <field name="holiday_id"/>
+ </field>
+ </field>
+ </record>
+</odoo> \ No newline at end of file