Files
odoo-usability/hr_holidays_usability/hr_holidays_view.xml
2017-06-06 17:57:05 +02:00

212 lines
9.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
© 2015-2017 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- 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" colspan="2">
<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="payslip_status" position="after">
<field name="payslip_date"/>
<field name="company_id" groups="base.group_multi_company"/>
</field>
</field>
</record>
<record id="view_holiday" model="ir.ui.view">
<field name="name">hr_holidays_usability.hr.holidays.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>
<button name="toggle_payslip_status" position="after">
<field name="payslip_date"/>
<field name="company_id" groups="base.group_multi_company"/>
</button>
</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="gray" position="after">
<filter string="Reported in Payslip" name="green" domain="[('payslip_status', '=', True)]" groups="hr_holidays.group_hr_holidays_manager"/>
</filter>
<filter name="group_type" position="after">
<filter name="group_payslip_date" string="Transfer to Payslip Date" context="{'group_by': 'payslip_date:day'}"/>
</filter>
</field>
</record>
<record id="hr_holiday_pivot" model="ir.ui.view">
<field name="name">hr_holidays_usability.hr_holiday_pivot</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<pivot string="Leave Requests">
<field name="employee_id" type="row"/>
<field name="holiday_status_id" type="col"/>
<field name="number_of_days_temp" type="measure"/>
</pivot>
</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_pivot" model="ir.actions.act_window.view">
<field name="sequence" eval="5"/>
<field name="view_mode">pivot</field>
<field name="view_id" ref="hr_holiday_pivot"/>
<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"/>
-->
<menuitem id="hr_holidays_administration_menu"
parent="hr_holidays.menu_hr_holidays_root"
groups="hr_holidays.group_hr_holidays_manager"
name="Administration" sequence="50"/>
<record id="hr_holidays.menu_open_company_allocation" model="ir.ui.menu">
<field name="groups_id" eval="[(4, ref('hr_holidays.group_hr_holidays_user'))]"/>
</record>
</odoo>