<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_xeno_leave_hr_update_form" model="ir.ui.view">
        <field name="name">xeno.leave.hr.update.form</field>
        <field name="model">xeno.leave.hr.update</field>
        <field name="arch" type="xml">
            <form>
                <field name="leave_id" invisible="1"/>
                <group>
                    <field name="employee_id" readonly="1"/>
                    <field name="holiday_status_id"/>
                    <field name="xeno_flexible_duration" invisible="1"/>
                    <div colspan="2" class="o_xeno_balance_strip"
                         invisible="not holiday_status_id">
                        <span class="o_xeno_bal">Total
                            <field name="xeno_balance_total"/></span>
                        <span class="o_xeno_bal">Used
                            <field name="xeno_balance_used"/></span>
                        <span class="o_xeno_bal">Pending
                            <field name="xeno_balance_pending"/></span>
                        <span class="o_xeno_bal o_xeno_bal_remaining">Remaining
                            <field name="xeno_balance_remaining"/></span>
                    </div>
                    <field name="xeno_request_unit" string="Leave Type Basis"
                           invisible="not xeno_flexible_duration"
                           required="xeno_flexible_duration"
                           widget="radio" options="{'horizontal': true}"
                           class="o_xeno_basis_pills"/>
                    <field name="request_date_from"/>
                    <field name="request_date_to"/>
                    <label for="request_hour_from" string="Hours"
                           invisible="xeno_request_unit != 'part_time'"/>
                    <div class="o_row" invisible="xeno_request_unit != 'part_time'">
                        <field name="request_hour_from"
                               required="xeno_request_unit == 'part_time'"
                               widget="float_time_selection" class="o_hr_narrow_field me-2"/>
                        <field name="request_hour_to"
                               required="xeno_request_unit == 'part_time'"
                               widget="float_time_selection" class="o_hr_narrow_field"/>
                    </div>
                    <field name="reason" placeholder="Why is HR changing this after submission?"/>
                </group>
                <footer>
                    <button name="action_apply" type="object" string="Apply" class="btn-primary"/>
                    <button string="Cancel" special="cancel" class="btn-secondary"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="action_xeno_leave_hr_update" model="ir.actions.act_window">
        <field name="name">HR Update</field>
        <field name="res_model">xeno.leave.hr.update</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>
</odoo>
