odex30_standard/hr_holidays_community/views/hr_holidays_views.xml

888 lines
42 KiB
XML

<?xml version='1.0' encoding='UTF-8' ?>
<odoo>
<!-- Graph report -->
<record id="view_evaluation_report_graph" model="ir.ui.view">
<field name="name">hr.holidays.graph</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<graph string="Appraisal Analysis" stacked="True">
<field name="employee_id" type="row"/>
<field name="holiday_status_id" type="row"/>
<field name="date_from" type="col"/>
<field name="number_of_days" type="measure"/>
</graph>
</field>
</record>
<record id="view_hr_holidays_filter" model="ir.ui.view">
<field name="name">hr.holidays.filter</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<search string="Search Leave">
<field name="name"/>
<!--filter domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="approve"/>
<filter string="Approved Leaves" domain="[('state', '=', 'validate')]" name="validated"/>
<separator/>
<filter name="active_types" string="Active Types" domain="[('holiday_status_id.active', '=', True)]" help="Filters only on allocations and requests that belong to an leave type that is 'active' (active field is True)"/>
<separator/>
<filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/>
<separator/>
<filter string="My Department Leaves" name="department" domain="[('department_id.manager_id.user_id', '=', uid)]" help="My Department Leaves"/>
<filter name="my_team_leaves" string="My Team Leaves" domain="[('employee_id.parent_id.user_id', '=', uid)]" groups="hr_holidays_community.group_hr_holidays_manager" help="Leaves of Your Team Member"/>
<separator/>
<filter string="To Report in Payslip" name="gray" domain="[('payslip_status', '=', False)]" groups="hr_holidays_community.group_hr_holidays_manager"/>
<separator/>
<filter string="To Do" name="todo" domain="[('payslip_status', '=', False), ('holiday_status_id.active', '=', True)]"/>
<separator/>
<filter name="year" string="Current Year"
domain="[('holiday_status_id.active', '=', True)]" help="Active Leaves and Allocations"/>
<separator/>
<filter string="My Requests" name="my_leaves" domain="[('user_id', '=', uid)]"/>
<separator/>
<filter name="leaves" string="Leaves" domain="[('type', '=', 'remove')]"/>
<filter name="allocations" string="Allocations" domain="[('type', '=', 'add')]"/-->
<filter string="My Requests" name="my_leaves" domain="[('user_id', '=', uid)]"/>
<separator/>
<field name="employee_id"/>
<field name="department_id"/>
<field name="holiday_status_id"/>
<group expand="0" string="Group By">
<filter name="group_name" string="Description" context="{'group_by':'name'}"/>
<filter name="group_employee" string="Employee" context="{'group_by':'employee_id'}"/>
<filter name="group_category" string="Category" context="{'group_by':'category_id'}"/>
<filter name="group_manager" string="Manager" context="{'group_by':'manager_id'}"/>
<filter name="group_second_approver_id" string="Validator"
context="{'group_by':'second_approver_id'}"/>
<filter name="group_type" string="Type" context="{'group_by':'holiday_status_id'}"/>
<separator/>
<filter name="group_date_from" string="Start Month" context="{'group_by':'date_from'}"/>
</group>
</search>
</field>
</record>
<!-- Holidays: Leave Request -->
<record id="view_holiday_new_calendar" model="ir.ui.view">
<field name="name">Leave Request</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<calendar string="Leave Request" date_start="date_from" date_stop="date_to" mode="month" quick_create="0"
color="employee_id">
<field name="display_name"/>
</calendar>
</field>
</record>
<!-- Holidays: Allocation Request -->
<record id="edit_holiday_new" model="ir.ui.view">
<field name="name">Leave Request</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<form string="Leave Request">
<field name="can_reset" invisible="1"/>
<field name="type" invisible="1"/>
<header>
<button string="Confirm" name="action_confirm" invisible="state != 'draft'" type="object"
class="oe_highlight"/>
<button string="Approve" name="action_approve" invisible="state != 'confirm'" type="object"
groups="hr_holidays_community.group_hr_holidays_user" class="oe_highlight"/>
<button string="Validate" name="action_validate" invisible="state != 'validate1'" type="object"
groups="hr_holidays_community.group_hr_holidays_manager" class="oe_highlight"/>
<button string="Refuse" name="action_refuse"
invisible="state not in ('confirm', 'validate', 'validate1')" type="object"
groups="hr_holidays_community.group_hr_holidays_user"/>
<button string="Reset to Draft" name="action_draft" type="object"
invisible="not can_reset or state not in ('confirm', 'refuse')"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate"/>
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="display_name"/>
</h1>
</div>
<group>
<group>
<field name="name" readonly="state not in ('draft', 'confirm')"/>
<field name="holiday_status_id" context="{'employee_id':employee_id}"/>
<label for="number_of_days_temp" string="Duration"/>
<div>
<div invisible="type == 'add'">
<field name="date_from" required="type == 'remove'" class="oe_inline"/>
<label for="date_to" string="-" class="oe_inline"/>
<field name="date_to" required="type == 'remove'" class="oe_inline"/>
</div>
<div>
<field name="number_of_days_temp" class="oe_inline"/>
days
</div>
</div>
</group>
<group>
<field name="holiday_type" readonly="type == 'remove' or state != 'draft'" string="Mode"
groups="hr_holidays_community.group_hr_holidays_user"
context="{'employee_id':employee_id}"/>
<field name="employee_id" required="holiday_type == 'employee'"
invisible="holiday_type == 'category'"
groups="hr_holidays_community.group_hr_holidays_user"/>
<field name="category_id" required="holiday_type == 'category'"
readonly="type == 'remove' or state not in ('draft', 'confirm')"
invisible="holiday_type == 'employee'"/>
<field name="department_id" groups="hr_holidays_community.group_hr_holidays_user"
readonly="type == 'add' or holiday_type == 'category' or state == 'validate'"
invisible="holiday_type == 'category'"/>
<field name="payslip_status" groups="hr_holidays_community.group_hr_holidays_manager"
invisible="type == 'add'" widget="toggle_button"/>
</group>
<field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..."
invisible="type == 'remove'"/>
<div groups="hr_holidays_community.group_hr_holidays_manager" invisible="type == 'add'">
<separator string="Comment by Manager"/>
<field name="report_note" placeholder="e.g. Report to the next month..."/>
</div>
</group>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="view_holiday_allocation_tree" model="ir.ui.view">
<field name="name">hr.holidays.allocation.tree</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<list decoration-danger="state == 'refuse'" decoration-info="state == 'draft'" string="Allocation Requests"
decoration-bf="message_needaction == True">
<field name="employee_id"/>
<field name="department_id"/>
<field name="holiday_status_id"/>
<field name="number_of_days" string="Allocated Days" sum="Remaining Days"/>
<field name="state"/>
<field name="holiday_type" invisible="1"/>
<field name="category_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="name" invisible="1"/>
<field name="manager_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="date_from" invisible="1"/>
<field name="date_to" invisible="1"/>
<field name="message_needaction" invisible="1"/>
</list>
</field>
</record>
<record id="view_holiday_allocation_tree_customize" model="ir.ui.view">
<field name="name">hr.holidays.allocation.tree.customize</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<list string="Allocation Requests" editable="top">
<field name="employee_id"/>
<field name="holiday_type"/>
<field name="holiday_status_id"/>
<field name="name" readonly="1"/>
<field name="date_from" required="1"/>
<field name="date_to" required="1"/>
<field name="number_of_days_temp" string="Allocated Days" sum="Remaining Days"/>
<field name="state"/>
<field name="payslip_status" widget="toggle_button"
options='{"active": "Reported in last payslips", "inactive": "To Report in Payslip"}'
groups="hr_holidays_community.group_hr_holidays_manager"/>
<field name="report_note" groups="hr_holidays_community.group_hr_holidays_manager"/>
</list>
</field>
</record>
<record id="view_holiday_simple" model="ir.ui.view">
<field name="name">hr.holidays.report_tree</field>
<field name="model">hr.holidays</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<list decoration-danger="state == 'refuse'" decoration-info="state == 'draft'" string="Leaves Summary">
<field name="employee_id"/>
<field name="category_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="type"/>
<field name="name"/>
<field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="holiday_status_id"/>
<field name="manager_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="state"/>
</list>
</field>
</record>
<record id="view_hr_holidays_kanban" model="ir.ui.view">
<field name="name">hr.holidays.kanban</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="employee_id"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="name"/>
<field name="number_of_days"/>
<templates>
<t t-name="card">
<div t-attf-class="oe_kanban_global_click">
<div>
<span>
<img t-att-src="kanban_image('hr.employee', 'image_small', record.employee_id.raw_value)"
t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"
width="40" height="40" class="oe_kanban_avatar pull-left mr4"/>
</span>
<span>
<div>
<strong class="o_kanban_record_title">
<t t-esc="record.employee_id.value"/>
</strong>
<span class="pull-right">
<field name="state" widget="label_selection"
options="{'classes': {'draft': 'default', 'validate': 'success','confirm': 'default', 'cancel': 'danger'}}"/>
</span>
</div>
<div class="text-muted o_kanban_record_subtitle">
<t t-esc="record.name.value"/>
</div>
</span>
</div>
<hr class="mt4 mb8"/>
<div class="o_kanban_record_bottom mt8 mb4">
<div t-attf-class="oe_kanban_bottom_left #{record.date_from.value ? 'mt8 mb4': ''}">
<table class="text-right" t-if="record.date_from.value">
<tr>
<td style="padding-bottom:4px">
<small class="text-muted">from</small>
</td>
<td style="padding:0 0 4px 4px">
<t t-esc="record.date_from.value"/>
</td>
</tr>
<tr>
<td>
<small class="text-muted">to</small>
</td>
<td style="padding-left:4px">
<t t-esc="record.date_to.value"/>
</td>
</tr>
</table>
</div>
<div t-attf-class="oe_kanban_bottom_right #{record.date_from.value ? 'mt8': ''}">
<span class="badge">
<t t-esc="record.number_of_days.value"/>
days
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_holiday_employee" model="ir.ui.view">
<field name="name">hr.holidays.report_employee_tree</field>
<field name="model">hr.holidays</field>
<field name="priority">21</field>
<field name="arch" type="xml">
<list decoration-danger="state == 'refuse'" decoration-info="state == 'draft'" string="Employee's Leave">
<field name="employee_id"/>
<field name="type"/>
<field name="name"/>
<field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="holiday_status_id"/>
<field name="state"/>
<field name="payslip_status" widget="toggle_button"
options='{"active": "Reported in last payslips", "inactive": "To Report in Payslip"}'
groups="hr_holidays_community.group_hr_holidays_manager"/>
<field name="report_note"/>
</list>
</field>
</record>
<record id="view_holiday" model="ir.ui.view">
<field name="name">hr.holidays.tree</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<list decoration-danger="state == 'refuse'" decoration-info="state == 'draft'" string="Leave Requests"
decoration-bf="message_needaction == True">
<field name="employee_id"/>
<field name="holiday_type" string="Mode" groups="base.group_no_one"/>
<field name="holiday_status_id"/>
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
<field name="state"/>
<field name="payslip_status" widget="toggle_button"
options='{"active": "Reported in last payslips", "inactive": "To Report in Payslip"}'
groups="hr_holidays_community.group_hr_holidays_manager"/>
<field name="category_id" invisible="1"/>
<field name="department_id" invisible="not context.get('set_visible' and False)"/>
<field name="manager_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="message_needaction" invisible="1"/>
</list>
</field>
</record>
<record id="action_hr_holidays_dashboard" model="ir.actions.act_window">
<field name="name">All Leaves</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">calendar</field>
<field name="context">{'search_default_year': 1, 'search_default_group_employee': 1}</field>
<field name="domain">[('holiday_type','=','employee'), ('type', '=', 'remove'), ('state', '!=', 'refuse')]
</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<menuitem
name="Leaves"
id="menu_hr_holidays_root"
sequence="95"
web_icon="hr_holidays_community,static/description/icon.png"
groups="base.group_user"/>
<menuitem
id="menu_hr_holidays_dashboard"
name="Dashboard"
parent="menu_hr_holidays_root"
sequence="1"
action="action_hr_holidays_dashboard"
groups="hr_holidays_community.group_hr_holidays_manager"/>
<menuitem
id="menu_hr_holidays_my_leaves"
name="My Leaves"
parent="menu_hr_holidays_root"
sequence="2"/>
<menuitem
id="menu_hr_holidays_approvals"
name="Leaves to Approve"
parent="menu_hr_holidays_root"
sequence="3"
groups="hr_holidays_community.group_hr_holidays_manager,hr_holidays_community.group_hr_holidays_user"/>
<menuitem
id="menu_hr_holidays_report"
name="Reporting"
parent="menu_hr_holidays_root"
sequence="99"
groups="hr_holidays_community.group_hr_holidays_manager,hr_holidays_community.group_hr_holidays_user"/>
<record id="open_ask_holidays" model="ir.actions.act_window">
<field name="name">Leaves Request</field>
<field name="res_model">hr.holidays</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="context">{
'default_type': 'remove',
'search_default_my_leaves': 1,
'needaction_menu_ref':
[
'hr_holidays_community.menu_open_company_allocation',
]
}
</field>
<field name="domain">[('type','=','remove')]</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new leave request.
</p>
<p>
Once you have recorded your leave request, it will be sent
to a manager for validation. Be sure to set the right leave
type (recuperation, legal leaves, sickness) and the exact
number of open days related to your leave.
</p>
</field>
</record>
<record id="action_open_ask_holidays_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">list</field>
<field name="view_id" ref="view_holiday"/>
<field name="act_window_id" ref="open_ask_holidays"/>
</record>
<record id="action_open_ask_holidays_form" model="ir.actions.act_window.view">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="act_window_id" ref="open_ask_holidays"/>
</record>
<record id="action_open_ask_holidays_calendar" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">calendar</field>
<field name="view_id" ref="view_holiday_new_calendar"/>
<field name="act_window_id" ref="open_ask_holidays"/>
</record>
<menuitem
id="menu_open_ask_holidays_new"
parent="menu_hr_holidays_my_leaves"
action="open_ask_holidays"
sequence="22"/>
<record model="ir.actions.act_window" id="request_approve_holidays">
<field name="name">Requests to Approve</field>
<field name="res_model">hr.holidays</field>
<field name="context">{
'default_type': 'remove',
'search_default_approve':1,
'needaction_menu_ref':
[
'hr_holidays_community.menu_open_ask_holidays_new',
'hr_holidays_community.menu_open_company_allocation',
'hr_holidays_community.menu_open_employee_leave',
]
}
</field>
<field name="domain">[('type','=','remove')]</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<record id="action_request_approve_holidays_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">list</field>
<field name="view_id" ref="view_holiday"/>
<field name="act_window_id" ref="request_approve_holidays"/>
</record>
<record id="action_request_approve_holidays_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="act_window_id" ref="request_approve_holidays"/>
</record>
<record id="open_allocation_holidays" model="ir.actions.act_window">
<field name="name">Allocation Request</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">list,kanban,form</field>
<field name="context">{
'default_type':'add',
'search_default_my_leaves': 1,
'needaction_menu_ref':
[
'hr_holidays_community.menu_open_company_allocation',
]
}
</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create a new leave allocation request.
</p>
</field>
<field name="domain">[('type','=','add')]</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<record id="action_open_allocation_holidays_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">list</field>
<field name="view_id" ref="view_holiday_allocation_tree"/>
<field name="act_window_id" ref="open_allocation_holidays"/>
</record>
<record id="action_open_allocation_holidays_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="act_window_id" ref="open_allocation_holidays"/>
</record>
<menuitem
id="menu_open_allocation_holidays"
parent="menu_hr_holidays_my_leaves"
action="open_allocation_holidays"
sequence="40"/>
<record id="request_approve_allocation" model="ir.actions.act_window">
<field name="name">Allocation Request</field>
<field name="res_model">hr.holidays</field>
<field name="context">{
'default_type': 'add',
'search_default_approve':1,
'needaction_menu_ref':
[
'hr_holidays_community.menu_open_allocation_holidays',
'hr_holidays_community.menu_open_company_allocation'
]
}
</field>
<field name="domain">[('type','=','add')]</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<record id="action_request_approve_allocation_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">list</field>
<field name="view_id" ref="view_holiday_allocation_tree"/>
<field name="act_window_id" ref="request_approve_allocation"/>
</record>
<record id="action_request_approve_allocation_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="edit_holiday_new"/>
<field name="act_window_id" ref="request_approve_allocation"/>
</record>
<record id="open_company_allocation" model="ir.actions.act_window">
<field name="name">Leaves Summary</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">list,kanban,form</field>
<field name="view_id" eval="view_holiday_simple"/>
<field name="context">{
'search_default_group_type': 1,
'search_default_year': 1 ,
'search_default_my_leaves': 1,
'needaction_menu_ref':
[
'hr_holidays_community.menu_open_ask_holidays_new',
'hr_holidays_community.menu_open_allocation_holidays',
'hr_holidays_community.menu_request_approve_allocation',
'hr_holidays_community.menu_open_employee_leave',
]
}
</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create a new leave request.
</p>
</field>
<field name="domain">[('holiday_type','=','employee')]</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<menuitem
id="menu_open_company_allocation"
name="Leaves Summary"
parent="menu_hr_holidays_my_leaves"
action="open_company_allocation"
sequence="21"/>
<record id="open_employee_leaves" model="ir.actions.act_window">
<field name="name">Leave Details</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">list,kanban,form,calendar</field>
<field name="view_id" eval="view_holiday_employee"/>
<field name="context">{'default_type': 'remove', 'search_default_todo': 1}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create a new leave request.
</p>
</field>
<field name="domain">[('type','=','remove')]</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<record id="open_department_holidays_approve" model="ir.actions.act_window">
<field name="name">Department Leaves</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">list,form,calendar</field>
<field name="context">{'search_default_department':1, 'search_default_approve':1}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create a new leave request.
</p>
</field>
<field name="domain">[('type','=','remove')]</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<menuitem
id="menu_open_department_leave_approve"
name="Leaves"
parent="menu_hr_holidays_approvals"
groups="hr_holidays_community.group_hr_holidays_manager,hr_holidays_community.group_hr_holidays_user"
action="open_department_holidays_approve"
sequence="1"/>
<record id="open_department_holidays_allocation_approve" model="ir.actions.act_window">
<field name="name">Department Leaves Allocation</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">list,form,calendar</field>
<field name="context">{'default_type':'add', 'search_default_department':1, 'search_default_approve':1}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create a new leave allocation.
</p>
</field>
<field name="domain">[('type','=','add')]</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<menuitem
id="menu_open_department_leave_allocation_approve"
groups="hr_holidays_community.group_hr_holidays_manager,hr_holidays_community.group_hr_holidays_user"
name="Leaves Allocation"
parent="menu_hr_holidays_approvals"
action="open_department_holidays_allocation_approve"
sequence="2"/>
<menuitem
id="menu_open_employee_leave"
name="Leave Details"
parent="menu_hr_holidays_report"
groups="hr_holidays_community.group_hr_holidays_manager,hr_holidays_community.group_hr_holidays_user"
action="open_employee_leaves"
sequence="4"/>
<!-- Holidays status -->
<record id="view_holidays_status_filter" model="ir.ui.view">
<field name="name">hr.holidays.status.filter</field>
<field name="model">hr.holidays.status</field>
<field name="arch" type="xml">
<search string="Search Leave Type">
<field name="name" string="Leave Types"/>
<field name="categ_id"/>
</search>
</field>
</record>
<record id="edit_holiday_status_form" model="ir.ui.view">
<field name="name">hr.holidays.status.form</field>
<field name="model">hr.holidays.status</field>
<field name="arch" type="xml">
<form string="Leave Type">
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" type="object" name="toggle_active" icon="fa-archive">
<field name="active" widget="boolean_button"
options='{"terminology": "archive"}'/>
</button>
</div>
<group>
<group name="description" string="Description">
<field name="name"/>
<field name="double_validation"/>
<field name="limit"/>
</group>
<group name="options" string="Options">
<field name="categ_id"/>
<field name="color_name"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_holiday_status_tree" model="ir.ui.view">
<field name="name">hr.holidays.status.tree</field>
<field name="model">hr.holidays.status</field>
<field name="arch" type="xml">
<list string="Leave Type">
<field name="name"/>
<field name="max_leaves"/>
<field name="leaves_taken"/>
<field name="remaining_leaves"/>
</list>
</field>
</record>
<record id="hr_holiday_status_view_kanban" model="ir.ui.view">
<field name="name">hr.holidays.status.kanban</field>
<field name="model">hr.holidays.status</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="card">
<div t-attf-class="oe_kanban_global_click">
<div>
<strong>
<field name="name"/>
</strong>
</div>
<div>
<span>Max Leaves:
<field name="max_leaves"/>
</span>
<span class="pull-right">Leaves 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.holidays.status.normal.tree</field>
<field name="model">hr.holidays.status</field>
<field name="priority">35</field>
<field name="arch" type="xml">
<list string="Leave Type">
<field name="name"/>
<field name="limit"/>
</list>
</field>
</record>
<record id="view_hr_holidays_status_search" model="ir.ui.view">
<field name="name">hr.holidays.status.search</field>
<field name="model">hr.holidays.status</field>
<field name="arch" type="xml">
<search string="Leave Type">
<field name="name" string="Leave Types"/>
<field name="categ_id"/>
</search>
</field>
</record>
<record id="open_view_holiday_status" model="ir.actions.act_window">
<field name="name">Leave Types</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.holidays.status</field>
<field name="view_mode">list,kanban,form</field>
<field name="view_id" eval="view_holiday_status_normal_tree"/>
<field name="search_view_id" ref="view_hr_holidays_status_search"/>
</record>
<menuitem
id="menu_hr_holidays_configuration"
name="Configuration"
parent="menu_hr_holidays_root"
sequence="100"
groups="hr_holidays_community.group_hr_holidays_manager"
action="open_view_holiday_status"/>
<!-- Shortcuts -->
<record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
<field name="name">Leaves</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">list,form</field>
<field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id,
'search_default_group_type': 1,
'search_default_year': 1}
</field>
<field name="domain">[('holiday_type','=','employee'), ('holiday_status_id.limit', '=', False), ('state','!=',
'refuse')]
</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<record id="act_hr_employee_holiday_request_approved" model="ir.actions.act_window">
<field name="name">Leaves to be reported in Payslip</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">list,form</field>
<field name="context">{'search_default_employee_id': [active_id], 'search_default_validated': True,
'search_default_gray': True}
</field>
<field name="domain">[('date_from','&gt;=', context_today().strftime("%Y-%m-1")), ('date_from','&lt;',
((context_today() + relativedelta(months=1)).strftime('%Y-%m-1')) )]
</field>
<field name="view_id" eval="view_holiday_allocation_tree_customize"/>
</record>
<!-- Assing leave -->
<record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
<field name="name">hr.employee.leave.tree</field>
<field name="model">hr.employee</field>
<field name="priority" eval="20"/>
<field name="arch" type="xml">
<list string="Assign Leaves" editable="bottom">
<field name="name" string="Employee"/>
<field name="remaining_leaves" string="Remaining Legal Leaves"/>
</list>
</field>
</record>
<record id="hr_holidays_leaves_assign_legal" model="ir.actions.act_window">
<field name="name">Allocate Leaves for Employees</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.employee</field>
<field name="view_mode">list,form</field>
<field name="view_id" ref="hr_holidays_leaves_assign_tree_view"/>
<field name="help" type="html">
<p>
You can assign remaining Legal Leaves for each employee, Odoo
will automatically create and validate allocation requests.
</p>
</field>
</record>
<record id="hr_holidays_action_request_from_department" model="ir.actions.act_window">
<field name="name">Leave Request to Approve</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">list,form</field>
<field name="context">{
'default_type': 'remove',
'search_default_department_id': [active_id],
'default_department_id': active_id,
'search_default_approve':1}
</field>
<field name="domain">[('type','=','remove')]</field>
<field name="view_id" ref="view_holiday"/>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<record id="hr_holidays_action_allocation_from_department" model="ir.actions.act_window">
<field name="name">Allocation Requests to Approve</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">list,form</field>
<field name="context">{
'default_type': 'add',
'search_default_department_id': [active_id],
'default_department_id': active_id,
'search_default_approve':1}
</field>
<field name="domain">[('type','=','add')]</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<record id="hr_employee_action_from_department" model="ir.actions.act_window">
<field name="name">Absent Employees</field>
<field name="res_model">hr.employee</field>
<field name="view_mode">kanban,list,form</field>
<field name="context">{
'search_default_is_absent_today': 1,
'search_default_department_id': [active_id],
'default_department_id': active_id}
</field>
<field name="search_view_id" ref="hr.view_employee_filter"/>
</record>
<record id="action_hr_holidays_leaves_analysis" model="ir.actions.act_window">
<field name="name">Leaves Analysis</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">graph,pivot</field>
<field name="domain">[('holiday_type','=','employee')]</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
<record id="action_hr_holidays_leaves_analysis_filtered" model="ir.actions.act_window">
<field name="name">Leaves Analysis</field>
<field name="res_model">hr.holidays</field>
<field name="view_mode">graph,pivot</field>
<field name="domain">[('holiday_type','=','employee')]</field>
<field name="context">{
'search_default_department_id': [active_id],
'default_department_id': active_id}
</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>
</odoo>