Initial commit: Hr packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:50 +02:00
commit 62531cd146
2820 changed files with 1432848 additions and 0 deletions

View file

@ -0,0 +1,129 @@
<?xml version='1.0' encoding='UTF-8' ?>
<odoo>
<menuitem
name="Time Off"
id="menu_hr_holidays_root"
sequence="225"
web_icon="hr_holidays,static/description/icon.svg"
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 Allocations"
parent="menu_hr_holidays_my_leaves"
action="hr_leave_allocation_action_my"
sequence="3"/>
<menuitem
id="menu_hr_holidays_dashboard"
name="Overview"
parent="menu_hr_holidays_root"
sequence="2"
action="action_hr_holidays_dashboard"/>
<menuitem
id="menu_hr_holidays_approvals"
name="Approvals"
parent="menu_hr_holidays_root"
sequence="3"
groups="hr_holidays.group_hr_holidays_responsible"/>
<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_user"
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"
groups="hr_holidays.group_hr_holidays_manager"
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_manager"
sequence="1"/>
<menuitem
id="hr_holidays_accrual_menu_configuration"
action="open_view_accrual_plans"
name="Accrual Plans"
parent="menu_hr_holidays_configuration"
groups="hr_holidays.group_hr_holidays_manager"
sequence="2"/>
<menuitem
id="hr_holidays_public_time_off_menu_configuration"
action="open_view_public_holiday"
name="Public Holidays"
parent="menu_hr_holidays_configuration"
groups="hr_holidays.group_hr_holidays_manager"
sequence="3"/>
<menuitem
id="hr_holidays_stress_day_menu_configuration"
action="hr_leave_stress_day_action"
name="Stress Days"
parent="menu_hr_holidays_configuration"
groups="hr_holidays.group_hr_holidays_manager"
sequence="4"/>
<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>

View file

@ -0,0 +1,203 @@
<?xml version='1.0' encoding='UTF-8' ?>
<odoo>
<record id="hr_accrual_level_view_form" model="ir.ui.view">
<field name="name">hr.leave.accrual.level.form</field>
<field name="model">hr.leave.accrual.level</field>
<field name="arch" type="xml">
<form string="Accrual Level">
<sheet>
<group>
<field name="sequence" invisible="1" force_save="1"/>
<label for="start_count"/>
<div class="o_col">
<div class="o_row">
<field name="start_count"/>
<field name="start_type" nolabel="1"/><label for="start_type" string="after allocation date" class="o_form_label"/>
</div>
</div>
<field name="is_based_on_worked_time"/>
<label for="added_value"/>
<div class="o_col">
<div class="o_row">
<field name="added_value"/>
<field name="added_value_type" nolabel="1"/>
</div>
</div>
<label for="frequency"/>
<div class="o_col">
<field name="frequency"/>
<div class="o_row" attrs="{'invisible': [('frequency', '!=', 'weekly')]}">
<label for="week_day" string="on"/><field name="week_day"/>
</div>
<div class="o_row" attrs="{'invisible': [('frequency', '!=', 'monthly')]}">
<label for="first_day_display" string="on the"/><field name="first_day_display" required="1"/> of the month
</div>
<div class="o_row" attrs="{'invisible': [('frequency', '!=', 'bimonthly')]}">
<label for="first_day_display" string="on the"/><field name="first_day_display" required="1"/> and on the <field name="second_day_display" required="1"/> of the month
</div>
<div class="o_row" attrs="{'invisible': [('frequency', '!=', 'biyearly')]}">
<label for="first_month_day_display" string="on the"/><field name="first_month_day_display" required="1"/> of <field name="first_month"/> and on the <field name="second_month_day_display" required="1"/> of <field name="second_month"/>
</div>
<div class="o_row" attrs="{'invisible': [('frequency', '!=', 'yearly')]}">
<label for="yearly_day_display" string="on the"/><field name="yearly_day_display" required="1"/> of <field name="yearly_month" class="w-25"/>
</div>
</div>
<label for="maximum_leave"/>
<div class="o_col">
<div class="o_row">
<field name="maximum_leave"/>
<!-- force_save is required here since it would otherwise not be saved due to the readonly
there is an issue when the field is present twice in the view. -->
<field name="added_value_type" nolabel="1" readonly="1" force_save="1"/>
</div>
</div>
<field name="action_with_unused_accruals" style="width: 40%"/>
<field name="postpone_max_days" attrs="{'invisible': [('action_with_unused_accruals', '!=', 'postponed')]}"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="hr_accrual_plan_view_tree" model="ir.ui.view">
<field name="name">hr.leave.accrual.plan.tree</field>
<field name="model">hr.leave.accrual.plan</field>
<field name="arch" type="xml">
<tree string="Accrual Plans">
<field name="name"/>
<field name="level_count"/>
<field name="time_off_type_id"/>
<field name="employees_count"/>
</tree>
</field>
</record>
<record id="hr_accrual_plan_view_form" model="ir.ui.view">
<field name="name">hr.leave.accrual.plan.form</field>
<field name="model">hr.leave.accrual.plan</field>
<field name="arch" type="xml">
<form string="Accrual Plan">
<field name="show_transition_mode" invisible="1" />
<sheet>
<div class="oe_button_box" name="button_box" attrs="{'invisible': [('id', '=', False)]}">
<button name="action_open_accrual_plan_employees" type="object" class="oe_stat_button" icon="fa-users">
<field name="employees_count" widget="statinfo"/>
</button>
</div>
<group>
<group>
<field name="name"/>
</group>
<group>
<field name="time_off_type_id"/>
</group>
<group>
<field name="transition_mode" widget="radio" attrs="{'invisible': [('show_transition_mode', '=', False)]}"/>
</group>
</group>
<span class="oe_grey" invisible="1">
</span>
<div class="o_hr_holidays_hierarchy">
<div class="o_hr_holidays_title">Rules</div>
<div class="o_hr_holidays_hierarchy_readonly" attrs="{'invisible': [('level_ids', '!=', [])]}">
<p>
No rule has been set up for this accrual plan.
</p>
</div>
<field name="level_ids" mode="kanban" nolabel="1"
class="o_hr_holidays_plan_level_container o_hr_holidays_plan_level_hierarchy"
add-label="Add a new level"
>
<kanban default_order="sequence">
<field name="sequence"/>
<field name="start_count"/>
<field name="start_type"/>
<field name="added_value"/>
<field name="added_value_type"/>
<field name="frequency"/>
<field name="week_day"/>
<field name="first_day"/>
<field name="second_day"/>
<field name="first_month_day"/>
<field name="first_month"/>
<field name="second_month_day"/>
<field name="second_month"/>
<field name="yearly_day"/>
<field name="yearly_month"/>
<field name="maximum_leave"/>
<field name="action_with_unused_accruals"/>
<field name="is_based_on_worked_time"/>
<templates>
<div t-name="kanban-box" class="border-0 bg-transparent">
<div class="o_hr_holidays_body oe_kanban_global_click">
<div class="o_hr_holidays_timeline text-center">
Level <span class="o_hr_holidays_plan_level_level"/>
</div>
<t t-if="!read_only_mode">
<a type="edit" t-attf-class="oe_kanban_action oe_kanban_action_a text-black">
<t t-call="level_content"/>
</a>
</t>
<t t-else="">
<t t-call="level_content"/>
</t>
</div>
</div>
<t t-name="level_content">
<div class="o_hr_holidays_card">
<div class="content">
<div>
<t t-if="record.start_count.value > 0">
Starts <field name="start_count" widget="integer"/> <field name="start_type"/> after allocation start date
</t>
<t t-else="">
Starts immediately after allocation start date
</t>
</div>
<div>
Adds <field name="added_value" widget="float_without_trailing_zeros"/> <field name="added_value_type"/>
<t t-if="record.is_based_on_worked_time.raw_value">(based on worked time)</t>
</div>
<div>
<field name="frequency"/>
<t t-if="record.frequency.raw_value == 'weekly'">
on <field name="week_day"/>
</t>
<t t-elif="record.frequency.raw_value === 'monthly'">
on the <field name="first_day"/> day of the month
</t>
<t t-elif="record.frequency.raw_value === 'bimonthly'">
on the <field name="first_day"/> and on the <field name="second_day"/> days of the months
</t>
<t t-elif="record.frequency.raw_value === 'biyearly'">
on the <field name="first_month_day"/> <field name="first_month"/> and on the <field name="second_month_day"/> <field name="second_month"/>
</t>
<t t-elif="record.frequency.raw_value === 'yearly'">
on <field name="yearly_day"/> <field name="yearly_month"/>
</t>
</div>
<div t-if="record.maximum_leave.value">
Limit of <field name="maximum_leave" widget="float_without_trailing_zeros"/> <field name="added_value_type"/>
</div>
<div t-if="record.action_with_unused_accruals.raw_value">
At the end of the year, unused accruals will be <t t-if="record.action_with_unused_accruals.raw_value == 'postponed'">postponed</t><t t-else="">lost</t>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</div>
</sheet>
</form>
</field>
</record>
<record id="open_view_accrual_plans" model="ir.actions.act_window">
<field name="name">Accrual Plans</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.leave.accrual.plan</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

View file

@ -0,0 +1,524 @@
<?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', '=', 'confirm')]" string="To Approve" name="second_approval"/>
<filter string="Approved Allocations" domain="[('state', '=', 'validate')]" name="validated"/>
<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="My Team" name="my_team" domain="['|', ('employee_id.leave_manager_id', '=', uid), ('employee_id.user_id', '=', uid)]" help="Time off of people you are manager of"/>
<filter string="My Department" 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 string="Active Employee" name="active_employee" domain="[('active_employee','=',True)]"/>
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
<separator/>
<filter name="year" string="Current Year"
domain="[
('date_from', '&gt;=', context_today().strftime('%Y-1-1')),
('date_from', '&lt;=', context_today().strftime('%Y-12-31')),
]"
help="Active Allocations"/>
<separator/>
<filter string="My Allocations" name="my_leaves" domain="[('employee_id.user_id', '=', uid)]"/>
<separator/>
<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'))
]"/>
<separator/>
<filter name="approved_state" string="To Approve or Approved Allocations" invisible="1"
domain="[('state', 'in', ('confirm', 'validate'))]"/>
<separator/>
<group expand="0" string="Group By">
<filter name="group_employee" string="Employee" context="{'group_by':'employee_id'}"/>
<filter name="group_type" string="Time Off Type" context="{'group_by':'holiday_status_id'}"/>
<filter name="group_allocation_type" string="Allocation Type" context="{'group_by':'allocation_type'}"/>
<filter name="group_state" string="Status" context="{'group_by': 'state'}"/>
</group>
<searchpanel>
<field name="state" string="Status"/>
<field name="department_id" string="Department" icon="fa-users"/>
</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"
invisible="1"
name="%(hr_leave_action_holiday_allocation_id)d"
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 id="title" class="oe_title">
<h2><field name="name" class="w-100" placeholder="e.g. Time Off type (From validity start to validity end / no limit)" attrs="{'invisible': [('state', 'not in', ('draft', 'confirm'))]}" required="1"/>
<field name="name_validity" attrs="{'invisible': [('state', 'in', ('draft', 'confirm'))]}"/></h2>
</div>
<group>
<group>
<field name="type_request_unit" invisible="1"/>
<field name="holiday_status_id" context="{'employee_id':employee_id, 'default_date_from':current_date, 'request_type':'allocation'}" options="{'always_reload': True}"/>
<field name="allocation_type" invisible="1" widget="radio"
attrs="{'readonly': ['|', ('is_officer', '=', False), ('state', 'not in', ('draft', 'confirm'))]}"/>
<field name="is_officer" invisible="1"/>
<field name="accrual_plan_id" attrs="{'invisible': [('allocation_type', '=', 'regular')], 'readonly': ['|', ('is_officer', '=', False), ('state', 'not in', ('draft', 'confirm'))]}"/>
<div class="o_td_label" name="validity_label">
<label for="date_from" string="Validity Period" attrs="{'invisible': ['|', ('allocation_type', '=', 'accrual'), ('state', 'not in', ('draft', 'confirm'))]}"/>
<label for="date_from" string="Start Date" attrs="{'invisible': [('allocation_type', '=', 'regular')]}"/>
</div>
<div class="o_row" name="validity">
<field name="date_from" widget="date" nolabel="1" readonly="1" attrs="{'invisible': ['&amp;', ('allocation_type', '=', 'regular'), ('state', 'not in', ('draft', 'confirm'))]}"/>
<i class="fa fa-long-arrow-right mx-2" aria-label="Arrow icon" title="Arrow" attrs="{'invisible': ['|', ('allocation_type', '=', 'accrual'), ('state', 'not in', ('draft', 'confirm'))]}"/>
<label class="mx-2" for="date_to" string="Run until" attrs="{'invisible': [('allocation_type', '=', 'regular')]}"/>
<field name="date_to" widget="date" nolabel="1" readonly="1" placeholder="No Limit" attrs="{'invisible': ['&amp;', ('allocation_type', '=', 'regular'), ('state', 'not in', ('draft', 'confirm'))]}"/>
<div id="no_limit_label" class="oe_read_only" attrs="{'invisible': ['|', '|', ('id', '=', False), ('date_to', '!=', False), ('state', 'not in', ('draft', 'confirm'))]}">No limit</div>
</div>
<field name="number_of_days" invisible="1"/>
<div class="o_td_label">
<label for="number_of_days_display" string="Duration"
attrs="{'readonly': [('allocation_type', '=', 'accrual'), ('state', 'not in', ('draft', 'confirm'))]}"/>
</div>
<div name="duration_display">
<field name="number_of_days_display" nolabel="1" style="width: 5rem;"
attrs="{'readonly': [
'|',
'|',
'&amp;',
('is_officer', '!=', True),
('state', 'not in', ('draft', 'confirm')),
('type_request_unit', '=', 'hour'),
('allocation_type', '=', 'accrual')
],
'invisible': [('type_request_unit', '=', 'hour')]}"/>
<field name="number_of_hours_display" nolabel="1" style="width: 5rem;"
attrs="{'readonly': [
'|',
'|',
'&amp;',
('is_officer', '!=', True),
('state', 'not in', ('draft', 'confirm')),
('type_request_unit', '!=', 'hour'),
('allocation_type', '=', 'accrual')
],
'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"/>
<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="Validate" name="action_validate" states="confirm" type="object" class="oe_highlight"/>
<button string="Refuse" name="action_refuse" type="object"
attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', 'not in', ('confirm','validate'))]}"/>
<button string="Mark as Draft" name="action_draft" type="object"
attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
</xpath>
<xpath expr="//div[@id='title']" position="replace">
<div class="oe_title">
<h2><field name="name" placeholder="e.g. Time Off type (From validity start to validity end / no limit)" required="1"/></h2>
</div>
</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">
<!-- :TestLeaveRequests.test_allocation_request -->
<field name="employee_id" invisible="1"/>
<field name="multi_employee" invisible="1" force_save="1"/>
<!-- Employee id is only visible if the allocation is created specifically for that user in `_action_validate_create_childs` -->
<field name="employee_id" groups="hr_holidays.group_hr_holidays_user"
attrs="{'invisible': ['|', '|', ('holiday_type', '!=', 'employee'), ('employee_id', '=', False), ('state', 'in', ('draft', 'cancel', 'confirm'))]}"
options="{'relation': 'hr.employee.public'}" widget="many2one_avatar_employee"/>
<field name="employee_ids" widget="many2many_avatar_employee"
groups="hr_holidays.group_hr_holidays_user"
attrs="{'required': [('holiday_type', '=', 'employee'), ('state', 'in', ('draft', 'cancel', 'confirm'))],
'invisible': ['|', ('holiday_type', '!=', 'employee'), '&amp;', ('state', 'not in', ('draft', 'cancel', 'confirm')), ('employee_id', '!=', False)]}"
options="{'relation': 'hr.employee.public'}"/>
</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="//label[@for='date_from']" position="replace">
<label for="date_from" string="Validity Period" attrs="{'invisible': [('allocation_type', '=', 'accrual')]}"/>
</xpath>
<xpath expr="//field[@name='date_from']" position="replace">
<field name="date_from" widget="date" nolabel="1" readonly="0" attrs="{'readonly': [('allocation_type', '=', 'accrual'), ('state', 'not in', ('draft', 'confirm'))]}"/>
</xpath>
<xpath expr="//i[hasclass('fa-long-arrow-right')]" position="replace">
<i class="fa fa-long-arrow-right mx-2" aria-label="Arrow icon" title="Arrow" attrs="{'invisible': [('allocation_type', '=', 'accrual')]}"/>
</xpath>
<xpath expr="//field[@name='date_to']" position="replace">
<field name="date_to" widget="date" nolabel="1" readonly="0" placeholder="No Limit" attrs="{'readonly': [('allocation_type', '=', 'accrual'), ('state', 'not in', ('draft', 'confirm'))]}"/>
</xpath>
<xpath expr="//div[@id='no_limit_label']" position="replace">
<div id="no_limit_label" class="oe_read_only" attrs="{'invisible': ['|', ('id', '=', False), ('date_to', '!=', False)]}">No limit</div>
</xpath>
</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>
<div name="validity_label" position="attributes">
<attribute name="invisible">1</attribute>
</div>
<div name="validity" position="attributes">
<attribute name="invisible">1</attribute>
</div>
<label for="date_from" position="attributes">
<attribute name="invisible">1</attribute>
</label>
<div class="oe_chatter" position="replace"/>
</field>
</record>
<record id="hr_leave_allocation_view_form_manager_dashboard" model="ir.ui.view">
<field name="name">hr.leave.allocation.view.form.manager.dashboard</field>
<field name="model">hr.leave.allocation</field>
<field name="inherit_id" ref="hr_holidays.hr_leave_allocation_view_form_manager"/>
<field name="mode">primary</field>
<field name="priority">16</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>
<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" decoration-info="state == 'draft'">
<field name="employee_id" decoration-muted="not active_employee"/>
<field name="department_id" optional="hide"/>
<field name="holiday_status_id" class="fw-bold"/>
<field name="name"/>
<field name="duration_display" string="Duration"/>
<field name="date_from" string="Validity Start" optional="hide"/>
<field name="date_to" string="Validity Stop" optional="hide"/>
<field name="allocation_type"/>
<field name="message_needaction" invisible="1"/>
<field name="active_employee" invisible="1"/>
<field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state == 'confirm'" decoration-success="state == 'validate'"/>
<button string="Validate" name="action_validate" type="object"
icon="fa-check"
states="confirm"
groups="hr_holidays.group_hr_holidays_user"/>
<button string="Refuse" name="action_refuse" type="object"
icon="fa-times"
states="confirm"
groups="hr_holidays.group_hr_holidays_user"/>
<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_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='my_team']" 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 g-0">
<div class="col-3">
<img t-att-src="kanban_image('hr.employee.public', 'avatar_128', record.employee_id.raw_value)"
t-att-title="record.employee_id.value"
t-att-alt="record.employee_id.value"
class="o_image_64_cover float-start mr4"/>
</div>
<div class="col-9">
<span class="badge rounded-pill float-end 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-bs-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 t-if="['validate', 'refuse'].includes(record.state.raw_value)">
<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"/>
<t t-set="classname" t-value="{'validate': 'text-bg-success', 'refuse': 'text-bg-danger'}[record.state.raw_value] || 'text-bg-light'"/>
<span t-attf-class="badge rounded-pill {{ classname }}"><t t-esc="record.state.value"/></span>
</div>
<div t-if="record.can_approve.raw_value">
<button t-if="record.state.raw_value === 'confirm'" name="action_validate" type="object" class="btn btn-link btn-sm ps-0">
<i class="fa fa-check"/> Validate
</button>
<button t-if="record.state.raw_value === 'confirm'" name="action_refuse" type="object" class="btn btn-link btn-sm ps-0">
<i class="fa fa-times"/> Refuse
</button>
</div>
</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', 'avatar_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="ms-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_my_team': 1,'search_default_approve': 2, 'search_default_active_employee': 3}</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">
if records:
records.action_validate()
</field>
</record>
</odoo>

View file

@ -0,0 +1,65 @@
<?xml version='1.0' encoding='UTF-8' ?>
<odoo>
<record id="hr_leave_stress_day_view_form" model="ir.ui.view">
<field name="model">hr.leave.stress.day</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="name"/>
<label for="start_date" string="Dates"/>
<div class="o_row">
<field name="start_date" nolabel="1" class="oe_inline" widget="daterange" options="{'related_end_date': 'end_date'}"/>
<i class="fa fa-long-arrow-right mx-2" aria-label="Arrow icon" title="To"/>
<field name="end_date" nolabel="1" class="oe_inline" widget="daterange" options="{'related_start_date': 'start_date'}"/>
</div>
</group>
<group>
<field name="color" widget="color_picker"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="hr_leave_stress_day_view_list" model="ir.ui.view">
<field name="model">hr.leave.stress.day</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="company_id" invisible="1"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company" optional="hide"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="color" widget="color_picker" width="1"/>
<field name="department_ids" widget="many2many_tags"/>
<field name="resource_calendar_id" optional="hide"/>
</tree>
</field>
</record>
<record id="hr_leave_stress_day_view_search" model="ir.ui.view">
<field name="model">hr.leave.stress.day</field>
<field name="arch" type="xml">
<search string="Stress Days">
<field name="name"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="company_id" groups="base.group_multi_company"/>
<separator />
<filter name="filter_date" date="start_date" default_period="this_year" string="Period"/>
</search>
</field>
</record>
<record id="hr_leave_stress_day_action" model="ir.actions.act_window">
<field name="name">Stress Days</field>
<field name="res_model">hr.leave.stress.day</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="hr_leave_stress_day_view_search"/>
<field name="context">{'search_default_filter_date': True}</field>
</record>
</odoo>

View file

@ -0,0 +1,139 @@
<?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="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-calendar"
attrs="{'invisible': ['|', ('requires_allocation', '=', 'no'), ('id', '=', False)]}"
help="Count of allocations for this time off type (approved or waiting for approbation) with a validity period starting this year.">
<div class="o_stat_info">
<field name="allocation_count"/>
<span class="o_stat_text">Allocations</span>
</div>
</button>
<button class="oe_stat_button"
type="object"
name="action_see_group_leaves"
icon="fa-calendar"
attrs="{'invisible': [('id', '=', False)]}"
help="Count of time off requests for this time off type (approved or waiting for approbation) with a start date in the current year.">
<div class="o_stat_info">
<field name="group_days_leave"/>
<span class="o_stat_text">Time Off</span>
</div>
</button>
<button class="oe_stat_button"
type="object"
name="action_see_accrual_plans"
icon="fa-calendar"
attrs="{'invisible': ['|', ('id', '=', False), ('accrual_count', '=', 0)]}"
help="Count of plans linked to this time off type.">
<div class="o_stat_info">
<field name="accrual_count"/>
<span class="o_stat_text">Accruals</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="leave_validation" id="time_off_requests" string="Time Off Requests">
<field name="active" invisible="1"/>
<field name="leave_validation_type" string="Approval" widget="radio"/>
<field name="responsible_id"
attrs="{
'invisible': [('leave_validation_type', 'in', ['no_validation', 'manager']), '|', ('requires_allocation', '=', 'no'), ('allocation_validation_type', '!=', 'officer')],
'required': ['|',('leave_validation_type', 'in', ['both', 'hr']), ('requires_allocation', '=', 'yes'), ('allocation_validation_type', '=', 'officer')]}"/>
<field name="request_unit"/>
<field name="support_document" string="Allow To Attach Supporting Document" />
<field name="time_type" required="1"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group name="allocation_validation" id="allocation_requests" string="Allocation Requests">
<field name="requires_allocation" widget="radio" options="{'horizontal':true}"/>
<field name="employee_requests" widget="radio" attrs="{'invisible': [('requires_allocation', '=', 'no')]}"/>
<field name="allocation_validation_type" string="Approval" widget="radio" attrs="{'invisible': ['|', ('requires_allocation', '=', 'no'), ('employee_requests', '=', 'no')]}"/>
</group>
</group>
<group name="visual" id="visual" >
<group colspan="2" string="Display Option">
</group>
<group colspan="2">
<field name="color" widget="color_picker" />
<field class="o_time_off_icon_types d-flex flex-wrap" name="icon_id" widget="hr_holidays_radio_image" options="{'horizontal': true}"/>
</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-end">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="sequence" widget="handle"/>
<field name="display_name"/>
<field name="allocation_validation_type"/>
<field name="employee_requests" optional="hide"/>
<field name="requires_allocation" optional="hide"/>
<field name="leave_validation_type" optional="hide"/>
<field name="company_id" groups="base.group_multi_company" optional="hide"/>
</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>

View file

@ -0,0 +1,830 @@
<?xml version='1.0' encoding='UTF-8' ?>
<odoo>
<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" sample="1">
<field name="employee_id"/>
<field name="holiday_status_id"/>
<field name="date_from"/>
<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="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"/>
<filter string="To Approve or Need Second Approval or Approved Time Off" domain="[('state', 'in', ('validate', 'validate1', 'confirm'))]" name="need_approval_approved"/>
<separator/>
<filter string="My Time Off" name="my_leaves" domain="[('employee_id.user_id', '=', uid)]"/>
<filter string="My Team" name="my_team" domain="['|', ('employee_id.leave_manager_id', '=', uid), ('employee_id.user_id', '=', uid)]" help="Time off of people you are manager of"/>
<filter string="My Department" name="department"
domain="[('employee_id.member_of_department', '=', True)]"
help="My Department"/>
<separator/>
<filter string="Active Employee" name="active_employee" domain="[('active_employee','=',True)]"/>
<separator/>
<filter name="this_year" string="Current Year"
domain="['&amp;', ('date_from', '&gt;=', context_today().strftime('%Y-1-1')),
('date_from', '&lt;=', context_today().strftime('%Y-12-31'))]"/>
<filter name="filter_date_from" date="date_from"/>
<separator/>
<filter name="active_time_off" string="Active Time Off"
domain="[('holiday_status_id.active', '=', True)]" help="Active Time Off"/>
<filter name="archive" string="Archived Time Off"
domain="[('holiday_status_id.active', '=', False)]" help="Archived Time Off"/>
<separator/>
<filter name="archived_leaves" string="Cancelled Time Off" domain="[('active', '=', False)]" />
<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'}"/>
<filter name="group_company" string="Company" context="{'group_by':'employee_company_id'}" groups="base.group_multi_company"/>
<separator/>
<filter name="group_date_from" string="Start Date" context="{'group_by':'date_from'}"/>
</group>
<searchpanel>
<field name="state" string="Status"/>
<field name="department_id" string="Department" icon="fa-users"/>
</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"/>
<field name="supported_attachment_ids_count"/>
<templates>
<t t-name="kanban-box">
<div class="d-flex flex-column justify-content-between oe_kanban_global_click container">
<div class="row g-0">
<div class="o_leave_kanban_info col-12">
<span class="badge rounded-pill float-end 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-bs-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>
<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 class="o_leave_kanban_name p-2">
<field name="name" nolabel="1"/>
</div>
</div>
</div>
<div class="d-flex justify-content-end">
<div class="me-2 d-flex align-items-center" t-if="!['draft'].includes(record.state.raw_value)">
<span t-if="record.state.raw_value === 'validate'" class="fa fa-check text-muted me-1" aria-label="validated"/>
<span t-if="record.state.raw_value === 'refuse'" class="fa fa-ban text-muted me-1" aria-label="refused"/>
<span t-if="['confirm', 'validate1'].includes(record.state.raw_value)" class="me-1" aria-label="to refuse"/>
<t t-set="classname"
t-value="{'validate': 'text-bg-success', 'refuse': 'text-bg-danger', 'confirm': 'text-bg-warning', 'validate1': 'text-bg-warning'}[record.state.raw_value] || 'text-bg-light'"/>
<span t-attf-class="badge rounded-pill {{ classname }}">
<t t-out="record.state.value"/>
</span>
</div>
<div class="me-2 align-items-center" t-if="['confirm', 'validate1'].includes(record.state.raw_value)">
<button t-if="record.state.raw_value === 'confirm'" name="action_approve" type="object" class="btn btn-link btn-sm ps-0"
groups="hr_holidays.group_hr_holidays_user">
<i class="fa fa-thumbs-up"/> Approve
</button>
<button t-if="record.state.raw_value === 'validate1'" name="action_validate" type="object" class="btn btn-link btn-sm ps-0"
groups="hr_holidays.group_hr_holidays_manager">
<i class="fa fa-check"/> Validate
</button>
<button t-if="['confirm', 'validate1'].includes(record.state.raw_value)" name="action_refuse" type="object" class="btn btn-link btn-sm ps-0"
groups="hr_holidays.group_hr_holidays_user">
<i class="fa fa-times"/> Refuse
</button>
</div>
<div class="text-end">
<button t-if="record.supported_attachment_ids_count.raw_value > 0" name="action_documents" type="object" class="btn btn-link btn-sm ps-0">
<i class="fa fa-paperclip"> <field name="supported_attachment_ids_count" nolabel="1"/></i>
</button>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="hr_leave_view_kanban_approve_department" model="ir.ui.view">
<field name="name">hr.leave.view.kanban.approve.department</field>
<field name="inherit_id" ref="hr_leave_view_kanban"/>
<field name="mode">primary</field>
<field name="model">hr.leave</field>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('o_leave_kanban_info')]" position='before'>
<div class="col-3">
<img t-att-src="kanban_image('hr.employee.public', 'avatar_128', record.employee_id.raw_value)"
t-att-title="record.employee_id.value"
t-att-alt="record.employee_id.value"
class="o_image_64_cover float-start mr4"/>
</div>
</xpath>
<xpath expr="//div[hasclass('o_leave_kanban_info')]" position="attributes">
<attribute name="class">o_leave_kanban_info col-9</attribute>
</xpath>
<xpath expr="//div[hasclass('o_leave_kanban_name')]" position="replace"/>
</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', 'avatar_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="ms-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" class="o_hr_leave_form">
<field name="active" invisible="1"/>
<field name="can_reset" invisible="1"/>
<field name="can_approve" invisible="1"/>
<field name="can_cancel" invisible="1"/>
<field name="holiday_allocation_id" invisible="1" force_save="1"/>
<field name="has_stress_day" invisible="1"/>
<header>
<button string="Confirm" name="action_confirm" type="object" class="oe_highlight" attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', '!=', 'draft'), ('active', '=', False)]}"/>
<button string="Approve" name="action_approve" type="object" class="oe_highlight" attrs="{'invisible': ['|', '|', '|', ('id', '=', False), ('active', '=', False), ('can_approve', '=', False), ('state', '!=', 'confirm')]}"/>
<button string="Validate" name="action_validate" states="validate1" type="object" groups="hr_holidays.group_hr_holidays_user" class="oe_highlight"/>
<button string="Refuse" name="action_refuse" type="object" attrs="{'invisible': ['|', '|', '|', ('id', '=', False), ('active', '=', False), ('can_approve', '=', False), ('state', 'not in', ('confirm','validate1','validate'))]}"/>
<button string="Cancel" name="action_cancel" type="object" attrs="{'invisible': ['|', ('active', '=', False), ('can_cancel', '=', False)]}" />
<button string="Mark as Draft" name="action_draft" type="object"
attrs="{'invisible': ['|', '|', ('id', '=', False), ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
<field name="state" widget="statusbar" statusbar_visible="confirm,validate" attrs="{'invisible': [('active', '=', False)]}"/>
</header>
<sheet>
<widget name="web_ribbon" title="Canceled" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="alert alert-info" role="alert" attrs="{'invisible': ['|', ('request_unit_hours', '=', False), '|', ('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="o_hr_leave_content row">
<div class="o_hr_leave_column col_left col-md-6 col-12">
<div name="title" class="o_hr_leave_title" invisible="1">
<field name="employee_id" readonly="1" force_save="1" invisible="1"/>
<field name="employee_ids" invisible="1"/>
<field name="display_name" attrs="{'invisible': [('holiday_status_id', '=', False)]}"/>
</div>
<group name="col_left">
<field name="holiday_status_id" force_save="1" domain="['|', ('requires_allocation', '=', 'no'), '&amp;', ('has_valid_allocation', '=', True), '&amp;', ('virtual_remaining_leaves', '&gt;', 0), ('max_leaves', '>', '0')]" context="{'employee_id':employee_id, 'default_date_from':date_from, 'default_date_to':date_to}" options="{'no_create': True, 'no_open': True, 'request_type':'leave'}" />
<field name="date_from" invisible="1" />
<field name="date_to" invisible="1" />
<!-- half day or custom hours: only show one date -->
<label for="request_date_from" attrs="{'invisible': [('request_unit_half', '=', False), ('request_unit_hours', '=', False)]}" string="Date" />
<div class="o_row" attrs="{'invisible': [('request_unit_half', '=', False), ('request_unit_hours', '=', False)]}">
<field name="request_date_from" class="oe_inline" string="Date" />
<field name="request_date_from_period" attrs="{'invisible': [('request_unit_half', '!=', True)], 'required': [('request_unit_half', '=', True)]}"/>
</div>
<!-- full days: show date start/end with daterange -->
<label for="request_date_from" attrs="{'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)]}" string="Dates" />
<div class="o_row" attrs="{'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)]}">
<span class="text-muted">From</span>
<field name="request_date_from" class="oe_inline" attrs="{'readonly': [('state', 'not in', ('draft', 'confirm'))],
'required': ['|', ('date_from', '=', False), ('date_to', '=', False)]
}" widget="daterange" options="{'related_end_date': 'request_date_to'}" />
<span class="text-muted">To</span>
<field name="request_date_to" class="oe_inline" attrs="{'readonly': [('state', 'not in', ('draft', 'confirm'))],
'required': ['|', ('date_from', '=', False), ('date_to', '=', False)]
}" widget="daterange" options="{'related_end_date': 'request_date_from'}" />
</div>
<label for="request_unit_half" string="" attrs="{'invisible': [('leave_type_request_unit', '=', 'day')]}"/>
<div class="o_row o_row_readonly oe_edit_only" style="margin-left: -2px;" attrs="{'invisible': [('leave_type_request_unit', '=', 'day')]}">
<field name="request_unit_half" class="oe_inline" attrs="{
'readonly': [('state', 'not in', ('draft', 'confirm'))],
'invisible': [('leave_type_request_unit', '=', 'day')]
}" />
<label for="request_unit_half" attrs="{
'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="ms-5" />
<label for="request_unit_hours" attrs="{
'invisible': [('leave_type_request_unit', '!=', 'hour')]
}" />
</div>
<label for="request_hour_from" string="" attrs="{'invisible': [('request_unit_hours', '=', False)]}"/>
<div class="o_row o_row_readonly" attrs="{'invisible': [('request_unit_hours', '=', False)]}">
<label for="request_hour_from" string="From" />
<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" />
<field name="request_hour_to" attrs="{
'readonly': [('state', '=', 'validate')],
'required': [('request_unit_hours', '=', True)],
'invisible': [('request_unit_hours', '=', False)]}" />
</div>
<label for="number_of_days_display" string="Duration" attrs="{'invisible': [('request_unit_half', '=', True), ('leave_type_request_unit', '!=', 'hour')]}" />
<div name="duration_display" attrs="{'invisible': [('request_unit_half', '=', True), ('leave_type_request_unit', '!=', 'hour')]}">
<div attrs="{'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)]}" class="o_row">
<field name="number_of_days_display" class="oe_inline" />
<span>Days</span>
</div>
<div attrs="{'invisible': [('leave_type_request_unit', '!=', 'hour')]}" class="o_row">
<field name="number_of_hours_text" />
</div>
</div>
<field name="name" attrs="{'readonly': [('state', 'not in', ('draft', 'confirm'))]}" widget="text" placeholder="Add a description..." />
<field name="user_id" invisible="1" />
<field name="leave_type_support_document" invisible="1" />
<label for="supported_attachment_ids" string="Supporting Document" attrs="{'invisible': ['|', ('leave_type_support_document', '=', False), ('state', 'not in', ('draft', 'confirm', 'validate1'))]}" />
<field name="supported_attachment_ids" widget="many2many_binary" nolabel="1" attrs="{'invisible': ['|', ('leave_type_support_document', '=', False), ('state', 'not in', ('draft', 'confirm', 'validate1'))]}" />
</group>
</div>
</div>
</sheet>
<div class="o_attachment_preview"/>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids" options="{'post_refresh': 'always'}"/>
</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_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="//group[@name='col_left']" position="attributes">
<attribute name="colspan">5</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_dashboard"
string="Time Off Request"
form_view_id="%(hr_holidays.hr_leave_view_form_dashboard_new_time_off)d"
event_open_popup="true"
date_start="date_from"
date_stop="date_to"
quick_add="False"
show_unusual_days="True"
color="color"
hide_time="True"
mode="year">
<field name="display_name"/>
<field name="holiday_status_id" filters="1" invisible="1" color="color"/>
<field name="state" invisible="1"/>
<field name="is_hatched" invisible="1" />
<field name="is_striked" invisible="1"/>
<field name="can_cancel" invisible="1"/>
</calendar>
</field>
</record>
<record id="hr_leave_employee_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 string="Time Off Request"
js_class="time_off_calendar_dashboard"
form_view_id="%(hr_holidays.hr_leave_view_form_dashboard_new_time_off)d"
event_open_popup="true"
date_start="date_from"
date_stop="date_to"
mode="year"
quick_add="False"
show_unusual_days="True"
color="color"
hide_time="True">
<field name="display_name"/>
<field name="holiday_status_id" filters="1" invisible="1" color="color"/>
<field name="state" invisible="1"/>
<field name="is_hatched" invisible="1" />
<field name="is_striked" invisible="1"/>
<field name="can_cancel" invisible="1"/>
</calendar>
</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">
<xpath expr="//div[@name='title']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//field[@name='holiday_status_id']" position="before">
<field name="holiday_type" string="Mode"
groups="hr_holidays.group_hr_holidays_user"/>
<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', '!=', 'department')]
}"/>
<field name="multi_employee" invisible="1" force_save="1"/>
<field name="employee_id" groups="hr_holidays.group_hr_holidays_user" attrs="{
'invisible': ['|', '|', ('holiday_type', '!=', 'employee'), ('state', '!=', 'validate'), ('employee_id', '=', False)]
}" widget="many2one_avatar_employee"/>
<field name="employee_ids" groups="hr_holidays.group_hr_holidays_user" attrs="{
'required': [('holiday_type', '=', 'employee'), ('state', 'in', ('draft', 'cancel', 'refuse'))],
'invisible': ['|', ('holiday_type', '!=', 'employee'), '&amp;', ('state', '=', 'validate'), ('employee_id', '!=', False)],
}" widget="many2many_avatar_employee"/>
</xpath>
<field name="name" position="replace"/>
<field name="user_id" position="before">
<field name="name" widget="text"/>
</field>
<xpath expr="//div[hasclass('col_left')]" position="after">
<div class="o_hr_leave_column col_right col-md-6 col-12">
<widget name="hr_leave_stats"/>
</div>
</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"
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"
show_unusual_days="True"
quick_add="False"
color="color">
<field name="display_name"/>
<field name="holiday_status_id" color="color" filters="1" invisible="1"/>
<field name="employee_id" filters="1" invisible="1"/>
<field name="is_hatched" invisible="1" />
<field name="is_striked" 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" invisible="1" />
<field name="all_employee_ids" widget="many2many_avatar_employee" decoration-muted="not active_employee" string="Employees" />
<field name="department_id" optional="hidden"/>
<field name="holiday_type" string="Mode" groups="base.group_no_one"/>
<field name="holiday_status_id" class="fw-bold"/>
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="duration_display" string="Duration"/>
<field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state in ('confirm','validate1')" decoration-success="state == 'validate'"/>
<field name="active_employee" invisible="1"/>
<field name="employee_company_id" invisible="1"/>
<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_user"/>
<button string="Refuse" name="action_refuse" type="object"
icon="fa-times"
states="confirm,validate1"
groups="hr_holidays.group_hr_holidays_user"/>
<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="//button[@name='action_approve']" position="attributes">
<attribute name="states"/>
<attribute name="attrs">{'invisible': 1}</attribute>
</xpath>
<xpath expr="//button[@name='action_validate']" position="attributes">
<attribute name="states"/>
<attribute name="attrs">{'invisible': 1}</attribute>
</xpath>
<xpath expr="//button[@name='action_refuse']" position="attributes">
<attribute name="states"/>
<attribute name="attrs">{'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='my_team']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//filter[@name='active_employee']" 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='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='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), ('employee_id.company_id', 'in', allowed_company_ids)]</field>
<field name="context">{'short_name': 1, 'search_default_active_time_off': 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 Request</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</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.leave</field>
<field name="view_mode">tree,form,kanban,activity</field>
<field name="context">{}</field>
<field name="search_view_id" ref="hr_leave_view_search_my"/>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('hr_leave_view_kanban')})]"/>
<field name="domain">[('user_id', '=', uid), ('employee_company_id', 'in', allowed_company_ids)]</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_approve': 1,
'search_default_my_team': 2,
'search_default_active_employee': 3,
'search_default_active_time_off': 4,
'hide_employee_name': 1,
'holiday_status_name_get': False}</field>
<field name="domain">['|', '|', '|', '|', ('employee_id.company_id', 'in', allowed_company_ids),
'&amp;', ('multi_employee', '=', True),
'&amp;', ('state', 'in', ['draft', 'confirm', 'validate1']),
('employee_ids.company_id', 'in', allowed_company_ids),
'&amp;', ('holiday_type', '=', 'company'),
('mode_company_id', 'in', allowed_company_ids),
('holiday_type', '=', 'department'),
('holiday_type', '=', 'category')]</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 employees PTOs, sick days, and approval status.
</p>
</field>
</record>
<record id="hr_leave_action_holiday_allocation_id" model="ir.actions.act_window">
<field name="name">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">{
'hide_employee_name': 1,
'holiday_status_name_get': False}
</field>
<field name="domain">[('holiday_allocation_id', '=', active_id)]</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 employees 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_approve_department"/>
<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_active_employee': 2, 'search_default_group_employee': 1, 'search_default_group_type': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No data to display
</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>

View file

@ -0,0 +1,335 @@
<?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">tree,kanban,form</field>
<field name="context">{
'search_default_is_absent': 1,
'searchpanel_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="arch" type="xml">
<data>
<xpath expr="//templates" position="before">
<t groups="hr_holidays.group_hr_holidays_user">
<field name="leave_to_approve_count"/>
<field name="allocation_to_approve_count"/>
<field name="total_employee"/>
<field name="absence_of_today"/>
</t>
</xpath>
<xpath expr="//div[hasclass('o_kanban_primary_right')]" position="inside">
<t groups="hr_holidays.group_hr_holidays_user">
<div t-if="record.leave_to_approve_count.raw_value > 0" class="row ml16">
<div class="col">
<a name="action_open_leave_department" type="object">
<field name="leave_to_approve_count"/> Time Off Requests
</a>
</div>
</div>
<div t-if="record.allocation_to_approve_count.raw_value > 0" class="row ml16">
<div class="col">
<a name="action_open_allocation_department" type="object">
<field name="allocation_to_approve_count"/> Allocation Requests
</a>
</div>
</div>
</t>
</xpath>
<xpath expr="//div[hasclass('o_kanban_card_lower_content')]" position="inside">
<t groups="hr_holidays.group_hr_holidays_user">
<div class="row o_kanban_primary_bottom bottom_block bg-view"
t-if="record.absence_of_today.raw_value > 0">
<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>
</t>
</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" groups="hr_holidays.group_hr_holidays_user">
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"
t-if="record.show_hr_icon_display.raw_value">
<!-- Employee is absent, in holiday but he is connected -->
<div class="float-end"
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-end"
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"
t-if="record.show_hr_icon_display.raw_value">
<!-- Employee is absent, in holiday but he is connected -->
<!-- green plane -->
<div class="float-end"
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-end"
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="luxon.DateTime.fromISO(record.leave_date_from.raw_value).toFormat('ccc d MMM') + ' - ' + luxon.DateTime.fromISO(record.leave_date_to.raw_value).toFormat('ccc d 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 = "priority" eval="20" />
<field name="arch" type="xml">
<xpath expr="//div[@id='hr_presence_status']" position="attributes">
<attribute name="attrs">
{'invisible': ['|', '|', ('last_activity', '=', False), ('user_id', '=', False), ('id', '=', False)]}
</attribute>
</xpath>
<xpath expr="//div[@id='hr_presence_status']" position="inside">
<!-- Employee is absent, in holiday but he is connected -->
<div role="img" class="fa fa-fw fa-plane text-success o_button_icon hr_presence" attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}" aria-label="Present but on leave" title="Present but on leave" name="presence_absent_active"/>
<!-- Employee is on holiday, not present and not connected -->
<div role="img" class="fa fa-fw fa-plane text-warning o_button_icon hr_presence" attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}" aria-label="On Leave" title="On Leave" name="presence_absent"/>
</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>
<xpath expr="//div[@name='button_box']" position="inside">
<field name="show_leaves" invisible="1"/>
<field name="is_absent" invisible="1"/>
<field name="hr_icon_display" invisible="1"/>
<button name="action_time_off_dashboard"
type="object"
class="oe_stat_button"
context="{'search_default_employee_ids': 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_text">
Off Till
</span>
<span class="o_stat_value">
<field name="leave_date_to"/>
</span>
</div>
</button>
<button name="action_time_off_dashboard"
type="object"
class="oe_stat_button"
icon="fa-calendar"
attrs="{'invisible': [('show_leaves','=', False)]}"
context="{'search_default_employee_ids': active_id}"
groups="base.group_user"
help="Remaining leaves">
<div class="o_field_widget o_stat_info" attrs="{'invisible': [('allocation_display', '=', '0')]}">
<span class="o_stat_value">
<field name="allocation_remaining_display"/>/<field name="allocation_display"/> Days
</span>
<span class="o_stat_text">
Time Off
</span>
</div>
<div class="o_field_widget o_stat_info" attrs="{'invisible': [('allocation_display', '!=', '0')]}">
<span class="o_stat_text">
Time Off
</span>
</div>
</button>
</xpath>
</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_id']" 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="company_id" invisible="1"/>
<field name="leave_manager_id"/>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<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_text">
Off Till
</span>
<span class="o_stat_value">
<field name="leave_date_to"/>
</span>
</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_text">
Off Till
</span>
<span class="o_stat_value">
<field name="leave_date_to"/>
</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_remaining_display"/>/<field name="allocation_display"/> Days
</span>
<span class="o_stat_text">
Time Off
</span>
</div>
</button>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,19 @@
<?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', '=', False), ('res_model', 'in', ['hr.leave', 'hr.leave.allocation'])]</field>
<field name="context">{'default_res_model': 'hr.leave'}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No data to display
</p>
<p>
Try to add some records, or make sure that there is no active filter in the search bar.
</p>
</field>
</record>
</odoo>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='UTF-8' ?>
<odoo>
<!-- Holiday on resource leave -->
<record id="resource_calendar_leaves_view_search_inherit" model="ir.ui.view">
<field name="name">resource.calendar.leaves.search.inherit</field>
<field name="model">resource.calendar.leaves</field>
<field name="inherit_id" ref="resource.view_resource_calendar_leaves_search"/>
<field name="arch" type="xml">
<filter name="resource" position="attributes">
<attribute name="invisible">1</attribute>
</filter>
</field>
</record>
<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>
<record id="resource_calendar_leaves_tree_inherit" model="ir.ui.view">
<field name="name">resource.calendar.leaves.tree.inherit</field>
<field name="model">resource.calendar.leaves</field>
<field name="inherit_id" ref="resource.resource_calendar_leave_tree"/>
<field name="mode">primary</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="editable">bottom</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="string">Name</attribute>
<attribute name="required">1</attribute>
</xpath>
<xpath expr="//field[@name='resource_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='date_to']" position="after">
<field name="company_id" invisible="1"/>
<xpath expr="//field[@name='calendar_id']" position="move"/>
</xpath>
</field>
</record>
<record id="resource_calendar_global_leaves_action_from_calendar" model="ir.actions.act_window">
<field name="name">Resource Time Off</field>
<field name="res_model">resource.calendar.leaves</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="resource_calendar_leaves_tree_inherit"/>
<field name="domain">['&amp;', ('resource_id', '=', False), ('calendar_id', 'in', (active_id, False))]</field>
<field name="context">{
'default_calendar_id': active_id,
'search_default_filter_date': True}</field>
<field name="search_view_id" ref="hr_holidays.resource_calendar_leaves_view_search_inherit"/>
</record>
<record id="resource_calendar_form_inherit" model="ir.ui.view">
<field name="name">resource.calendar.form.inherit</field>
<field name="model">resource.calendar</field>
<field name="inherit_id" ref="resource.resource_calendar_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='%(resource.resource_calendar_leaves_action_from_calendar)d']" position="before">
<button name="%(resource_calendar_global_leaves_action_from_calendar)d" type="action"
icon="fa-sun-o" class="oe_stat_button">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">
<field name="associated_leaves_count"/> Public
</span>
<span class="o_stat_text">
Time Off
</span>
</div>
</button>
</xpath>
</field>
</record>
<record id="open_view_public_holiday" model="ir.actions.act_window">
<field name="name">Public Holidays</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">resource.calendar.leaves</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('resource_id', '=', False)]</field>
<field name="view_id" ref="resource_calendar_leaves_tree_inherit"/>
<field name="context">{
'search_default_filter_date': True}</field>
</record>
</odoo>