hr_holidays_ru/views/hr_holidays_views.xml

171 lines
7.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="open_view_holiday_settings_tree" model="ir.ui.view">
<field name="name">hr.holidays.settings_tree</field>
<field name="model">holidays.calendar</field>
<field name="arch" type="xml">
<tree string="Working Time">
<field name="name" string="Weekends"/>
<field name="year"/>
</tree>
</field>
</record>
<record id="open_view_holiday_settings_form" model="ir.ui.view">
<field name="name">hr.holidays.settings_form</field>
<field name="model">holidays.calendar</field>
<field name="arch" type="xml">
<form string="Working Time">
<sheet string="Working Time">
<h1>
<field name="name"/>
</h1>
<group>
<field name="year"/>
</group>
<notebook>
<page string="Global Leaves">
<field name="global_leave_ids">
<tree editable="top">
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="type_transfer_day"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Your Action Window Definition -->
<record id="open_view_holiday_settings" model="ir.actions.act_window">
<field name="name">Holidays and non-working days</field>
<field name="res_model">holidays.calendar</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form</field>
</record>
<!-- Adds "Calendar days" and "Working days" units of measures in Leave form. -->
<record id="hr_leave_view_form_inherit" model="ir.ui.view">
<field name="name">hr_holidays_ru.hr_leave_view_form_inherit</field>
<field name="model">hr.leave</field>
<field name="inherit_id" ref="hr_holidays.hr_leave_view_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet/div/div/group" position="before">
<div>
<div invisible="leave_type_request_unit != 'hour'">
<field name="number_of_hours_display" nolabel="1" class="oe_inline"/>
<span class="ml8">Hours</span>
</div>
<div invisible="leave_type_request_unit != 'c_day'">
<field name="number_of_days_display" nolabel="1" class="oe_inline"/>
<span class="ml8">Calendar days</span>
</div>
<div invisible="leave_type_request_unit != 'day'">
<field name="number_of_days_display" nolabel="1" class="oe_inline"/>
<span class="ml8">Working days</span>
</div>
</div>
</xpath>
<xpath expr="//label[@for='request_date_from']" position="before">
<field name="working_hours_display" invisible="leave_type_request_unit != 'c_day'"/>
</xpath>
<xpath expr="//field[@name='request_unit_half']" position="replace">
<field
name="request_unit_half"
readonly="state not in ('draft', 'confirm')"
invisible="leave_type_request_unit == 'c_day'"
/>
</xpath>
<xpath expr="//label[@for='request_unit_half']" position="replace">
<label for="request_unit_half"
invisible="leave_type_request_unit == 'c_day'"
/>
</xpath>
</field>
</record>
<!-- Adds "Calendar days" and "Working days" units of measures in Leaves kanban view -->
<record id="hr_leave_view_kanban_inherit" model="ir.ui.view">
<field name="name">hr_holidays_ru.hr_leave_view_kanban_inherit</field>
<field name="model">hr.leave</field>
<field name="inherit_id" ref="hr_holidays.hr_leave_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//span[hasclass('rounded-pill')]" position="replace">
<field name="leave_type_request_unit" invisible="1"/>
<span class="badge badge-pill float-right mt4 mr16" invisible="leave_type_request_unit != 'c_day'">
<t t-esc="record.number_of_days.value"/> Calendar days
</span>
<span class="badge badge-pill float-right mt4 mr16" invisible="leave_type_request_unit == 'c_day'">
<t t-esc="record.number_of_days.value"/> Working days
</span>
</xpath>
</field>
</record>
<record id="hr_leave_allocation_view_form_inherit" model="ir.ui.view">
<field name="name">hr_holidays_ru.hr_leave_allocation_view_form_inherit</field>
<field name="model">hr.leave.allocation</field>
<field name="inherit_id" ref="hr_holidays.hr_leave_allocation_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='duration_display']" position="replace">
<div>
<field name="number_of_days_display" class="oe_inline" nolabel="1"
readonly="state not in ('draft', 'confirm')"
invisible="type_request_unit == 'hour'"/>
<field name="number_of_hours_display" class="oe_inline" nolabel="1"
readonly="state not in ('draft', 'confirm')"
invisible="type_request_unit != 'hour'"/>
<span class="ml8" invisible="type_request_unit != 'c_day'">Calendar days</span>
<span class="ml8" invisible="type_request_unit != 'day'">Working days</span>
<span class="ml8" invisible="type_request_unit != 'hour'">Hours</span>
</div>
</xpath>
</field>
</record>
<!-- Adds "Exclude holidays" checkbox in Leave type form. -->
<!-- Adds notification for holidays settings -->
<record id="edit_holiday_status_form_inherit" model="ir.ui.view">
<field name="name">hr_holidays_ru.edit_holiday_status_form_inherit</field>
<field name="model">hr.leave.type</field>
<field name="inherit_id" ref="hr_holidays.edit_holiday_status_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='request_unit']" position="after">
<field name="exclude_holidays" invisible="request_unit != 'c_day'"/>
</xpath>
<xpath expr="//group[@id='visual']" position="before">
<group name="notifications" id="notifications">
<group string="Notification about holidays">
<field name="notify_before_start_holidays"/>
<field name="responsible_employee_to_notify_id" invisible="notify_before_start_holidays == False"/>
<field name="days_before_holidays" invisible="notify_before_start_holidays == False"/>
</group>
<group>
</group>
</group>
</xpath>
</field>
</record>
<menuitem
action="open_view_holiday_settings"
id="hr_holidays_status_menu_configuration"
parent="hr_holidays.menu_hr_holidays_configuration"
name="Holidays and non-working days"
groups="hr_holidays.group_hr_holidays_manager"
sequence="4"/>
</data>
</odoo>