204 lines
8.8 KiB
XML
204 lines
8.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
Copyright (C) 2015 Akretion (http://www.akretion.com/)
|
|
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
|
The licence is in the file __openerp__.py
|
|
-->
|
|
|
|
<openerp>
|
|
<data>
|
|
|
|
<!-- Beware that, in v8, the form view hr_holidays.allocation_company_new
|
|
is not used any more (even if it's defined in the XML ; the form view
|
|
hr_holidays.edit_holiday_new is used for both leaves and allocation -->
|
|
<record id="edit_holiday_new" model="ir.ui.view">
|
|
<field name="name">hr_holidays_usability.leave_request_form</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="inherit_id" ref="hr_holidays.edit_holiday_new"/>
|
|
<field name="arch" type="xml">
|
|
<field name="date_from" position="attributes">
|
|
<attribute name="attrs">{}</attribute>
|
|
</field>
|
|
<field name="date_to" position="attributes">
|
|
<attribute name="attrs">{}</attribute>
|
|
</field>
|
|
<xpath expr="//field[@name='date_from']/.." position="attributes">
|
|
<attribute name="attrs">{}</attribute>
|
|
<attribute name="invisible">1</attribute>
|
|
</xpath>
|
|
<field name="number_of_days_temp" position="attributes">
|
|
<attribute name="attrs">{'readonly': [('type', '=', 'remove')]}</attribute>
|
|
</field>
|
|
<field name="holiday_status_id" position="after">
|
|
<field name="vacation_date_from" attrs="{'required': [('type', '=', 'remove')], 'invisible': [('type', '=', 'add')]}"/>
|
|
<field name="vacation_time_from" attrs="{'required': [('type', '=', 'remove')], 'invisible': [('type', '=', 'add')]}"/>
|
|
<field name="vacation_date_to" attrs="{'required': [('type', '=', 'remove')], 'invisible': [('type', '=', 'add')]}"/>
|
|
<field name="vacation_time_to" attrs="{'required': [('type', '=', 'remove')], 'invisible': [('type', '=', 'add')]}"/>
|
|
</field>
|
|
<field name="notes" position="replace">
|
|
<group name="bottom">
|
|
<group string="Message for the Manager" name="notes">
|
|
<field name="notes" nolabel="1" placeholder="Add a message for your manager..."/>
|
|
</group>
|
|
<group string="Counter for this leave type" name="counters" attrs="{'invisible': [('limit', '=', True)]}">
|
|
<field name="limit" invisible="1"/>
|
|
<label for="total_allocated_leaves"/>
|
|
<div>
|
|
<field name="total_allocated_leaves" class="oe_inline"/>
|
|
<label string=" days" class="oe_inline"/>
|
|
</div>
|
|
<label for="current_leaves_taken"/>
|
|
<div>
|
|
<field name="current_leaves_taken" class="oe_inline"/>
|
|
<label string=" days" class="oe_inline"/>
|
|
</div>
|
|
<label for="current_remaining_leaves"/>
|
|
<div>
|
|
<field name="current_remaining_leaves" class="oe_inline"/>
|
|
<label string=" days" class="oe_inline"/>
|
|
</div>
|
|
</group>
|
|
</group>
|
|
</field>
|
|
<field name="department_id" position="after">
|
|
<field name="company_id" groups="base.group_multi_company"/>
|
|
<field name="posted_date" groups="base.group_hr_manager"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_holiday" model="ir.ui.view">
|
|
<field name="name">hr_holidays_usability.leave_request_tree</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="inherit_id" ref="hr_holidays.view_holiday"/>
|
|
<field name="arch" type="xml">
|
|
<field name="date_from" position="attributes">
|
|
<attribute name="invisible">1</attribute>
|
|
</field>
|
|
<field name="date_from" position="after">
|
|
<field name="vacation_date_from"/>
|
|
<field name="vacation_time_from"/>
|
|
</field>
|
|
<field name="date_to" position="attributes">
|
|
<attribute name="invisible">1</attribute>
|
|
</field>
|
|
<field name="date_to" position="after">
|
|
<field name="vacation_date_to"/>
|
|
<field name="vacation_time_to"/>
|
|
</field>
|
|
<field name="holiday_status_id" position="attributes">
|
|
<attribute name="invisible">0</attribute>
|
|
</field>
|
|
<field name="holiday_status_id" position="after">
|
|
<field name="posted_date" groups="base.group_hr_manager"/>
|
|
<field name="company_id" groups="base.group_multi_company"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
<record id="view_holiday_simple" model="ir.ui.view">
|
|
<field name="name">hr_holidays_usability.report_tree</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="inherit_id" ref="hr_holidays.view_holiday_simple"/>
|
|
<field name="arch" type="xml">
|
|
<field name="date_from" position="attributes">
|
|
<attribute name="invisible">1</attribute>
|
|
</field>
|
|
<field name="date_from" position="after">
|
|
<field name="vacation_date_from"/>
|
|
<field name="vacation_time_from"/>
|
|
</field>
|
|
<field name="date_to" position="attributes">
|
|
<attribute name="invisible">1</attribute>
|
|
</field>
|
|
<field name="date_to" position="after">
|
|
<field name="vacation_date_to"/>
|
|
<field name="vacation_time_to"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
<record id="view_hr_holidays_filter" model="ir.ui.view">
|
|
<field name="name">hr_holidays_usability.leave_request_tree</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="inherit_id" ref="hr_holidays.view_hr_holidays_filter"/>
|
|
<field name="arch" type="xml">
|
|
<filter name="validated" position="after">
|
|
<filter name="posted" string="Posted" domain="[('posted_date', '!=', False)]"/>
|
|
</filter>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="hr_holiday_graph" model="ir.ui.view">
|
|
<field name="name">hr_holidays_usability.hr_holiday_graph</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="arch" type="xml">
|
|
<graph string="Leave Requests" type="pivot">
|
|
<field name="employee_id" type="row"/>
|
|
<field name="holiday_status_id" type="col"/>
|
|
<field name="number_of_days_temp" type="measure"/>
|
|
</graph>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="edit_holiday_status_form" model="ir.ui.view">
|
|
<field name="name">hr_holidays_usability.hr.holidays.status.form</field>
|
|
<field name="model">hr.holidays.status</field>
|
|
<field name="inherit_id" ref="hr_holidays.edit_holiday_status_form"/>
|
|
<field name="arch" type="xml">
|
|
<field name="name" position="after">
|
|
<field name="vacation_compute_method"/>
|
|
</field>
|
|
<field name="limit" position="after">
|
|
<field name="add_validation_manager"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_holiday_status_normal_tree" model="ir.ui.view">
|
|
<field name="name">hr_holidays_usability.hr.holidays.status.normal.tree</field>
|
|
<field name="model">hr.holidays.status</field>
|
|
<field name="inherit_id" ref="hr_holidays.view_holiday_status_normal_tree"/>
|
|
<field name="arch" type="xml">
|
|
<field name="name" position="after">
|
|
<field name="vacation_compute_method"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- On the leave requests, put tree view by default instead of calendar -->
|
|
<record id="hr_holidays.action_open_ask_holidays_calendar" model="ir.actions.act_window.view">
|
|
<field name="sequence" eval="4"/>
|
|
</record>
|
|
|
|
<record id="action_open_ask_holidays_graph" model="ir.actions.act_window.view">
|
|
<field name="sequence" eval="5"/>
|
|
<field name="view_mode">graph</field>
|
|
<field name="view_id" ref="hr_holiday_graph"/>
|
|
<field name="act_window_id" ref="hr_holidays.open_ask_holidays"/>
|
|
</record>
|
|
|
|
<record id="resource_calendar_leaves_cal_first_action" model="ir.actions.act_window">
|
|
<field name="name">Leaves Calendar</field>
|
|
<field name="res_model">resource.calendar.leaves</field>
|
|
<field name="view_mode">calendar,tree,form</field>
|
|
</record>
|
|
<!-- Warning: when you have mrp installed, there is an ACL that gives write/create access to MRP Users on resource.calendar.leaves You should inherit this ACL with XMLID mrp.access_resource_calendar_leaves_user to give only read access:
|
|
|
|
mrp.access_resource_calendar_leaves_user,only read access to manufacuting user,resource.model_resource_calendar_leaves,mrp.group_mrp_user,1,0,0,0
|
|
|
|
-->
|
|
|
|
<menuitem id="resource_calendar_leaves_cal_first_menu"
|
|
action="resource_calendar_leaves_cal_first_action"
|
|
parent="hr_holidays.menu_open_ask_holidays" sequence="100"/>
|
|
|
|
<record id="hr_holidays.menu_open_company_allocation" model="ir.ui.menu">
|
|
<field name="groups_id" eval="[(4, ref('base.group_hr_user'))]"/>
|
|
</record>
|
|
|
|
</data>
|
|
</openerp>
|