flectra/addons/hr_holidays/views/hr_holidays_views.xml
2018-01-16 02:34:37 -08:00

844 lines
43 KiB
XML

<?xml version='1.0' encoding='UTF-8' ?>
<flectra>
<!-- 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.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.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')]"/>
<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_add="False" 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" states="draft" type="object" class="oe_highlight"/>
<button string="Approve" name="action_approve" states="confirm" type="object" groups="hr_holidays.group_hr_holidays_user" class="oe_highlight"/>
<button string="Validate" name="action_validate" states="validate1" type="object" groups="hr_holidays.group_hr_holidays_manager" class="oe_highlight"/>
<button string="Refuse" name="action_refuse" states="confirm,validate,validate1" type="object" groups="hr_holidays.group_hr_holidays_user"/>
<button string="Reset to Draft" name="action_draft" type="object"
attrs="{'invisible': ['|', ('can_reset', '=', False), ('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" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
<field name="holiday_status_id" context="{'employee_id':employee_id}"/>
<label for="number_of_days_temp" string="Duration"/>
<div>
<div attrs="{'invisible': [('type', '=', 'add')]}">
<field name="date_from" attrs="{'required':[('type', '=', 'remove')]}" class="oe_inline"/>
<label string="-" class="oe_inline"/>
<field name="date_to" attrs="{'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" attrs="{'readonly':[('type', '=', 'remove'),('state','!=','draft')]}" string="Mode" groups="hr_holidays.group_hr_holidays_user" context="{'employee_id':employee_id}" />
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" groups="hr_holidays.group_hr_holidays_user"/>
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly': [('type', '=', 'remove'),('state','!=','draft'), ('state','!=','confirm')], 'invisible':[('holiday_type','=','employee')]}"/>
<field name="department_id" groups="hr_holidays.group_hr_holidays_user" attrs="{'readonly':['|','|' ,('type','=','add'),('holiday_type','=','category'),('state','=', 'validate')],'invisible':[('holiday_type','=','category')]}"/>
<field name="payslip_status" groups="hr_holidays.group_hr_holidays_manager" attrs="{'invisible':[('type','=','add')]}" widget="toggle_button"/>
</group>
<field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..." attrs="{'invisible': [('type', '=', 'remove')]}"/>
<div groups="hr_holidays.group_hr_holidays_manager" attrs="{'invisible':[('type','=','add')]}">
<separator string="Comment by Manager"/>
<field name="report_note" placeholder="e.g. Report to the next month..."/>
</div>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</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">
<tree decoration-danger="state == 'refuse'" decoration-info="state == 'draft'" string="Allocation Requests"
decoration-bf="message_needaction == True">
<field name="employee_id"/>
<field name="holiday_type"/>
<field name="category_id"/>
<field name="department_id" invisible="1"/>
<field name="holiday_status_id"/>
<field name="name"/>
<field name="number_of_days" string="Allocated Days" sum="Remaining Days"/>
<field name="manager_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="message_needaction" invisible="1"/>
<field name="state"/>
</tree>
</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">
<tree 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.group_hr_holidays_manager"/>
<field name="report_note" groups="hr_holidays.group_hr_holidays_manager"/>
</tree>
</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">
<tree 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"/>
</tree>
</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="kanban-box">
<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" 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="kanban_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">
<tree 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.group_hr_holidays_manager"/>
<field name="report_note"/>
</tree>
</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">
<tree 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.group_hr_holidays_manager"/>
<field name="category_id" invisible="1"/>
<field name="department_id" invisible="not context.get('set_visible',False)"/>
<field name="manager_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="message_needaction" invisible="1"/>
</tree>
</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_type">form</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,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.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.group_hr_holidays_manager,hr_holidays.group_hr_holidays_user"/>
<menuitem
id="menu_hr_holidays_report"
name="Reporting"
parent="menu_hr_holidays_root"
sequence="99"
groups="hr_holidays.group_hr_holidays_manager,hr_holidays.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_type">form</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.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">tree</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="view_type">form</field>
<field name="context">{
'default_type': 'remove',
'search_default_approve':1,
'needaction_menu_ref':
[
'hr_holidays.menu_open_ask_holidays_new',
'hr_holidays.menu_open_company_allocation',
'hr_holidays.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">tree</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_type">form</field>
<field name="view_mode">tree,kanban,form</field>
<field name="context">{
'default_type':'add',
'search_default_my_leaves': 1,
'needaction_menu_ref':
[
'hr_holidays.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">tree</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="view_type">form</field>
<field name="context">{
'default_type': 'add',
'search_default_approve':1,
'needaction_menu_ref':
[
'hr_holidays.menu_open_allocation_holidays',
'hr_holidays.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">tree</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_type">form</field>
<field name="view_mode">tree,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.menu_open_ask_holidays_new',
'hr_holidays.menu_open_allocation_holidays',
'hr_holidays.menu_request_approve_allocation',
'hr_holidays.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_type">form</field>
<field name="view_mode">tree,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_type">form</field>
<field name="view_mode">tree,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.group_hr_holidays_manager,hr_holidays.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_type">form</field>
<field name="view_mode">tree,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.group_hr_holidays_manager,hr_holidays.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.group_hr_holidays_manager,hr_holidays.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">
<tree string="Leave Type">
<field name="name"/>
<field name="max_leaves"/>
<field name="leaves_taken"/>
<field name="remaining_leaves"/>
</tree>
</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="kanban-box">
<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">
<tree string="Leave Type">
<field name="name"/>
<field name="limit"/>
</tree>
</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_type">form</field>
<field name="view_mode">tree,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.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="src_model">hr.employee</field>
<field name="view_type">form</field>
<field name="view_mode">tree,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="src_model">hr.employee</field>
<field name="view_type">form</field>
<field name="view_mode">tree,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">
<tree string="Assign Leaves" editable="bottom">
<field name="name" string="Employee"/>
<field name="remaining_leaves" string="Remaining Legal Leaves"/>
</tree>
</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_type">form</field>
<field name="view_mode">tree,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, Flectra
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_type">form</field>
<field name="view_mode">tree,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_type">form</field>
<field name="view_mode">tree,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_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{
'search_default_is_absent_totay': 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_type">form</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_type">form</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>
</flectra>