<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <!-- Tree View -->
    <record id="view_employee_document_tree" model="ir.ui.view">
        <field name="name">employee.document.tree</field>
        <field name="model">employee.document</field>
        <field name="arch" type="xml">
            <tree string="Employee Documents">
                <field name="name"/>
                <field name="employee_id"/>
                <field name="document_type"/>
                <field name="upload_date"/>
            </tree>
        </field>
    </record>

    <!-- Form View -->
    <record id="view_employee_document_form" model="ir.ui.view">
        <field name="name">employee.document.form</field>
        <field name="model">employee.document</field>
        <field name="arch" type="xml">
            <form string="Employee Document">
                <sheet>
                    <group>
                        <group>
                            <field name="name"/>
                            <field name="employee_id"/>
                            <field name="document_type"/>
                        </group>
                        <group>
                            <field name="upload_date"/>
                            <field name="file" filename="file_name"/>
                            <field name="file_name" invisible="1"/>
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Search View -->
    <record id="view_employee_document_search" model="ir.ui.view">
        <field name="name">employee.document.search</field>
        <field name="model">employee.document</field>
        <field name="arch" type="xml">
            <search string="Search Employee Documents">
                <field name="name"/>
                <field name="employee_id"/>
                <field name="document_type"/>
                <group expand="0" string="Group By">
                    <filter string="Employee" name="group_by_employee" context="{'group_by':'employee_id'}"/>
                    <filter string="Document Type" name="group_by_type" context="{'group_by':'document_type'}"/>
                </group>
            </search>
        </field>
    </record>

    <!-- Haction -->
    <record id="action_employee_document" model="ir.actions.act_window">
        <field name="name">Documents</field>
        <field name="res_model">employee.document</field>
        <field name="view_mode">tree,form</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Create your first employee document
            </p>
        </field>
    </record>

    <!-- Menu Item -->
    <menuitem id="menu_employee_document"
              name="Documents"
              parent="hr.menu_hr_root"
              action="action_employee_document"
              sequence="5"/>

</odoo>
