<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <!-- Terminology: "Time Off Types" -> "Leave Types" on the page title
             (core action hr_holidays.open_view_holiday_status, action-235). -->
        <record id="hr_holidays.open_view_holiday_status" model="ir.actions.act_window">
            <field name="name">Leave Types</field>
        </record>

        <record id="view_hr_leave_type_form_xeno_timing" model="ir.ui.view">
            <field name="name">hr.leave.type.form.xeno.timing</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="//sheet" position="inside">
                    <group string="Request Timing Limits">
                        <field name="xeno_advance_days"/>
                        <field name="xeno_max_backdate_days"/>
                        <field name="xeno_prorated"/>
                    </group>
                    <group string="Additional Settings">
                        <field name="unpaid"/>
                        <field name="xeno_flexible_duration"/>
                    </group>
                    <group string="Employee-Facing Detail">
                        <field name="xeno_detail" nolabel="1" colspan="2"
                               placeholder="Explain entitlement/procedure to employees, e.g. '60 days unpaid + 60 days paid, weekends and public holidays are counted within the 60 days.' Shown on the Apply for Leave form once this type is selected."/>
                    </group>
                </xpath>
            </field>
        </record>

        <record id="view_hr_leave_type_form_xeno_simplify" model="ir.ui.view">
            <field name="name">hr.leave.type.form.xeno.simplify</field>
            <field name="model">hr.leave.type</field>
            <field name="inherit_id" ref="hr_holidays.edit_holiday_status_form"/>
            <!-- HR reported the native form as too cluttered with fields
                 this company never uses (Enterprise accrual-plan
                 machinery, payroll legal-leave typing, negative-balance
                 settings, a decorative icon picker). Kept visible: name,
                 requires_allocation, leave_validation_type/
                 allocation_validation_type (both drive this deployment's
                 own approval-chain features, see leave_type.py/
                 leave_approver.py), support_document (matches the
                 "Requires Document" checkbox from the Laravel reference
                 design), color (drives the leave-type-colored pills used
                 across the app), and the 3 stat buttons (navigation, not
                 data fields). company_id/country_id are already hidden by
                 their own base.group_multi_company gate (single-company
                 deployment). employee_requests is hidden too: allocation
                 creation is blocked company-wide for regular employees
                 (see leave_security.xml), so the checkbox no longer does
                 anything. request_unit (native Day/Half-Day/Hours radio) is
                 hidden too, since this deployment's own
                 xeno_flexible_duration (Day/Half-Day/Hour picked per
                 REQUEST, see hr_leave_views.xml) supersedes it entirely,
                 and showing both was exactly the kind of confusing,
                 unused-here field HR flagged. unpaid (Laravel's "Paid"
                 checkbox, inverted) and xeno_flexible_duration itself had
                 no field on this form at all until now, added in
                 "Additional Settings" above, closing that gap. -->
            <field name="arch" type="xml">
                <xpath expr="//field[@name='responsible_ids']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//field[@name='time_type']" position="attributes">
                    <attribute name="invisible">1</attribute>
                    <attribute name="required">0</attribute>
                </xpath>
                <xpath expr="//field[@name='request_unit']" position="attributes">
                    <attribute name="invisible">1</attribute>
                    <attribute name="required">0</attribute>
                </xpath>
                <xpath expr="//field[@name='employee_requests']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//label[@for='include_public_holidays_in_duration']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//field[@name='include_public_holidays_in_duration']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//label[@for='hide_on_dashboard']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//field[@name='hide_on_dashboard']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//label[@for='elligible_for_accrual_rate']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//field[@name='elligible_for_accrual_rate']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//label[@for='allow_request_on_top']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//field[@name='allow_request_on_top']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//group[@name='negative_cap']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//field[@name='icon_id']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
            </field>
        </record>
    </data>
    <data noupdate="1">
        <menuitem id="hr_holidays.hr_holidays_status_menu_configuration" name="Leave Types"/>
    </data>
</odoo>
