odoo18/addons_extensions/hr_timeoff_extended/views/hr_timeoff.xml

233 lines
15 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="hr_accrual_plan_view_form_inherit" model="ir.ui.view">
<field name="name">hr.leave.accrual.plan.inherit</field>
<field name="model">hr.leave.accrual.plan</field>
<field name="inherit_id" ref="hr_holidays.hr_accrual_plan_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='carryover']" position="after">
<field name="time_off_type_id" required="1"/>
<div>
<strong>Allocation Starts</strong>
<field name="accrual_start_count" style="width: 2rem"/>
<field name="accrual_start_type" style="width: 4.75rem"/>
<strong>after employee joining date</strong>
</div>
</xpath>
<xpath expr="//field[@name='level_ids']/kanban" position="replace">
<kanban default_order="sequence">
<field name="sequence"/>
<field name="action_with_unused_accruals"/>
<field name="accrual_validity_count"/>
<field name="accrual_validity_type"/>
<field name="cap_accrued_time"/>
<field name="accrual_validity"/>
<templates>
<div t-name="card" class="bg-transparent border-0">
<div class="o_hr_holidays_body">
<div class="o_hr_holidays_timeline text-center">
<t t-if="record.start_count.raw_value &gt; 0">
Experience between <field name="start_count"/> <field name="start_type"/> and <field name="max_start_count"/> <field name="max_start_type"/>
</t>
<t t-else="">
initially
</t>
</div>
<t t-if="!read_only_mode">
<a type="edit" t-attf-class="oe_kanban_action text-black">
<t t-call="level_content"/>
</a>
</t>
<t t-else="">
<t t-call="level_content"/>
</t>
</div>
</div>
<t t-name="level_content">
<div class="o_hr_holidays_card">
<div class="content container" style="width: 560px;">
<div class="row w-100">
<div class="pe-0 me-0" style="width: 6rem;">
<field name="added_value" invisible="1"/>
<span t-out="record.added_value.raw_value"/> <field name="added_value_type"/>,
</div>
<div class="col-auto m-0 p-0">
<field name="level_frequency" class="ms-1"/>
<t t-if="record.level_frequency.raw_value === 'weekly'">
on <field name="week_day"/>
</t>
<t t-elif="record.level_frequency.raw_value === 'monthly'">
on the <field name="first_day"/> day of the month
</t>
<t t-elif="record.level_frequency.raw_value === 'bimonthly'">
on the <field name="first_day"/> and on the <field name="second_day"/> days of the months
</t>
<t t-elif="record.level_frequency.raw_value === 'biyearly'">
on the <field name="first_month_day"/> <field name="first_month"/> and on the <field name="second_month_day"/> <field name="second_month"/>
</t>
<t t-elif="record.level_frequency.raw_value === 'yearly'">
on <field name="yearly_day"/> <field name="yearly_month"/>
</t>
</div>
</div>
<div class="row text-muted">
<div class="pe-0 me-0" style="width: 6rem;">
Cap:
</div>
<div class="col-3 m-0 ps-1 d-flex">
<t t-if="record.cap_accrued_time.raw_value and record.maximum_leave.raw_value &gt; 0">
<field name="maximum_leave" widget="float_without_trailing_zeros"/> <field class="ms-1" name="added_value_type"/>
</t>
<t t-else="">
Unlimited
</t>
</div>
</div>
<div class="row text-muted" invisible="1">
<div class="pe-0 me-0" style="width: 6rem;">
Carry over:
</div>
<div class="col-6 m-0 ps-1">
<t t-if="record.action_with_unused_accruals.raw_value === 'all'">all
<span invisible="not accrual_validity">
- Valid for <field name="accrual_validity_count"/> <field name="accrual_validity_type"/>
</span>
</t>
<t t-elif="record.action_with_unused_accruals.raw_value === 'maximum'">up to <field name="postpone_max_days"/> <t t-esc="record.added_value_type.raw_value"/>
<span invisible="not accrual_validity">
- Valid for <field name="accrual_validity_count"/> <field name="accrual_validity_type"/>
</span>
</t>
<t t-else="">no</t>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</xpath>
</field>
</record>
<record id="hr_leave_view_form_inherit" model="ir.ui.view">
<field name="name">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="//field[@name='state']" position="attributes">
<attribute name="statusbar_visible">draft,confirm,validate,cancel</attribute>
</xpath>
<xpath expr="//button[@name='action_approve']" position="before">
<button string="Submit" name="action_draft" type="object" class="oe_highlight"
invisible="state != 'draft'"/>
</xpath>
<xpath expr="//div/field[@name='request_date_from']" position="attributes">
<attribute name="readonly">state != 'draft'</attribute>
</xpath>
<xpath expr="//div/field[@name='request_date_from_period']" position="attributes">
<attribute name="readonly">state != 'draft'</attribute>
</xpath>
<xpath expr="//div[2]/field[@name='request_date_from']" position="attributes">
<attribute name="readonly">state != 'draft'</attribute>
</xpath>
<xpath expr="//div[3]/field[@name='request_unit_half']" position="attributes">
<attribute name="readonly">state != 'draft'</attribute>
</xpath>
<xpath expr="//div[3]/field[@name='request_unit_hours']" position="attributes">
<attribute name="readonly">state != 'draft'</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="readonly">state != 'draft'</attribute>
</xpath>
<xpath expr="//label[@for='supported_attachment_ids']" position="attributes">
<attribute name="invisible">not leave_type_support_document or state not in ('draft', 'confirm',
'validate1')
</attribute>
</xpath>
<xpath expr="//field[@name='supported_attachment_ids']" position="attributes">
<attribute name="invisible">not leave_type_support_document or state not in ('draft', 'confirm',
'validate1')
</attribute>
</xpath>
</field>
</record>
<record id="hr_accrual_level_view_form_inherit" model="ir.ui.view">
<field name="name">hr.leave.accrual.level.form.inherit</field>
<field name="model">hr.leave.accrual.level</field>
<field name="inherit_id" ref="hr_holidays.hr_accrual_level_view_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='accrue']" position="replace">
<group name="accrue" col="1" width="800px">
<div class="o_td_label">
<label for="added_value" string="Employee accrue"/>
</div>
<div>
<field name="accrued_gain_time" invisible="1"/>
<field name="can_modify_value_type" invisible="1"/>
<field name="added_value" widget="float_without_trailing_zeros" style="width: 4rem" class="me-1"/>
<field name="added_value_type" style="width: 3.4rem" nolabel="1" readonly="not can_modify_value_type"/>
</div>
<div style="width: 5rem"/>
<div name="daily" invisible="level_frequency != 'daily'">
<field name="level_frequency" style="width: 5rem"/>
</div>
<div name="weekly" invisible="level_frequency != 'weekly'">
<field name="level_frequency" style="width: 4.5rem;"/>
<label for="week_day" string="on" class="me-1"/><field name="week_day" style="width: 6.6rem"/>
</div>
<div name="monthly" invisible="level_frequency != 'monthly'">
<field name="level_frequency" style="width: 4.5rem"/>
<label for="first_day_display" string="on the" class="me-1"/>
<field name="first_day_display" required="1" style="width: 4rem"/>
of the month
</div>
<div name="yearly" invisible="level_frequency != 'yearly'">
<field name="level_frequency" style="width: 4rem"/>
<label for="yearly_day_display" string="on the" class="me-1"/>
<field name="yearly_day_display" required="1" style="width: 4rem"/> of <field name="yearly_month" required="1" style="width: 5.4rem"/>
</div>
</group>
</xpath>
<xpath expr="//group[@name='milestone']" position="replace">
<group name="milestone">
<div class="o_td_label">
<label for="start_count" string="Employee total Experience"/>
</div>
<div>Min
<field name="start_count" style="width: 2rem" required="max_start_count > 0 or max_start_type != False"/>
<field name="start_type" style="width: 4.75rem" required="max_start_count > 0 or max_start_type != False"/>
&amp;
Max of
<field name="max_start_count" style="width: 2rem" required="start_count > 0 or start_type != False"/>
<field name="max_start_type" style="width: 4.75rem" required="start_count > 0 or start_type != False"/>
Experience is required
</div>
</group>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="hr_holidays_hr_leave_allocation_view_form_manager_inherit">
<field name="name">hr.leave.allocation.view.form.manager.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="//field[@name='allocation_type']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
</field>
</record>
</data>
</odoo>