<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="hr_attendance_reason_view_form" model="ir.ui.view">
        <field name="name">hr.attendance.reason.form</field>
        <field name="model">hr.attendance.reason</field>
        <field name="arch" type="xml">
            <form string="Define attendance reason">
                <sheet>
                    <group col="4">
                        <field name="name" />
                        <field name="code" />
                        <field name="action_type" />
                        <field
                            name="show_on_attendance_screen"
                            attrs="{'invisible': [('action_type', '==', False)]}"
                        />
                        <field name="company_id" groups="base.group_multi_company" />
                    </group>
                </sheet>
            </form>
        </field>
    </record>
    <record id="hr_attendance_reason_view_tree" model="ir.ui.view">
        <field name="name">hr.attendance.reason.tree</field>
        <field name="model">hr.attendance.reason</field>
        <field name="arch" type="xml">
            <tree>
                <field name="sequence" widget="handle" />
                <field name="name" />
                <field name="code" />
                <field name="action_type" />
                <field name="show_on_attendance_screen" />
                <field name="company_id" groups="base.group_multi_company" />
            </tree>
        </field>
    </record>
    <record id="hr_attendance_reason_action" model="ir.actions.act_window">
        <field name="name">Attendance Reasons</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">hr.attendance.reason</field>
        <field name="view_mode">tree,form</field>
        <field name="view_id" ref="hr_attendance_reason_view_tree" />
    </record>
    <menuitem
        id="hr_attendance_settings_redefinition_menu"
        name="Configuration"
        parent="hr_attendance.menu_hr_attendance_settings"
        sequence="99"
        action="hr_attendance.action_hr_attendance_settings"
        groups="hr_attendance.group_hr_attendance_manager"
    />
    <menuitem
        id="hr_attendance_reason_menu"
        name="Reasons"
        parent="hr_attendance.menu_hr_attendance_settings"
        action="hr_attendance_reason_action"
        sequence="110"
        groups="hr_attendance.group_hr_attendance_manager"
    />
    <record id="hr_attendance.menu_hr_attendance_settings" model="ir.ui.menu">
        <!-- We need to leave the action empty for consistency because we are going
            to set different submenus, otherwise the configuration menu would not be
            displayed to a basic user. !-->
        <field name="action" eval="False" />
    </record>
</odoo>
