<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_xeno_leave_holiday_deduct_form" model="ir.ui.view">
        <field name="name">xeno.leave.holiday.deduct.form</field>
        <field name="model">xeno.leave.holiday.deduct</field>
        <field name="arch" type="xml">
            <form string="Deduct Leave for Company Holiday">
                <div class="alert alert-info" role="alert">
                    Company holiday policy: deducts Annual Leave first, falling back to
                    Personal Leave and then Unpaid Leave if the balance is insufficient
                    to cover the whole period. Immediately approved, no approval step.
                </div>
                <group>
                    <field name="employee_ids" widget="many2many_tags"/>
                    <field name="date_from"/>
                    <field name="date_to"/>
                    <field name="name" string="Reason"/>
                </group>
                <footer>
                    <button name="action_apply" type="object"
                            string="Deduct Leave" class="btn-primary"/>
                    <button string="Cancel" special="cancel" class="btn-secondary"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="action_xeno_leave_holiday_deduct" model="ir.actions.act_window">
        <field name="name">Deduct Leave for Company Holiday</field>
        <field name="res_model">xeno.leave.holiday.deduct</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>

    <!-- No sidebar entry: this wizard is only reachable from the Leave
         List page's own "Deduct Holiday" button, which builds its own
         inline action (res_model + target=new) and doesn't reference
         action_xeno_leave_holiday_deduct at all, so removing the menu is safe. -->
    <delete model="ir.ui.menu" id="menu_xeno_leave_holiday_deduct"/>
</odoo>
