<odoo>
    <record model="ir.actions.act_window" id="action_shift_template">
        <field name="name">Planning Action</field>
        <field name="res_model">shift.template</field>
        <field name="view_mode">kanban,tree,form,calendar,pivot</field>
        <field name="context">{'group_by': 'day_nb_id',
            'search_default_planning_id': active_id,
            'default_planning_id': active_id}
        </field>
    </record>

    <record model="ir.actions.act_window" id="action_generate_shift_wizard">
        <field name="name">Instanciate Planning Action</field>
        <field name="res_model">shift.generate_planning</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>

    <record model="ir.ui.view" id="planning_view_form">
        <field name="name">Planning Form</field>
        <field name="model">shift.planning</field>
        <field name="arch" type="xml">
            <form>
                <header>
                    <button
                        type="action"
                        name="%(action_generate_shift_wizard)d"
                        string="Generate shifts"
                        colspan="2"
                    />
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box">
                        <button
                            class="oe_stat_button"
                            type="action"
                            name="%(action_shift_template)d"
                            icon="fa-book"
                            string="Shift Template"
                        >
                        </button>
                    </div>
                    <div class="oe_title">
                        <h1>
                            <field name="name" placeholder="name" />
                        </h1>
                    </div>
                    <group>
                        <field name="sequence" />
                        <field name="periodicity" />
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record model="ir.ui.view" id="planning_view_tree">
        <field name="name">Planning Tree</field>
        <field name="model">shift.planning</field>
        <field name="arch" type="xml">
            <tree>
                <field name="sequence" />
                <field name="name" />
                <button
                    type="action"
                    name="%(action_shift_template)d"
                    string="Shift Template"
                />
            </tree>
        </field>
    </record>

    <record model="ir.ui.view" id="daynumber_view_tree">
        <field name="name">Day Number List</field>
        <field name="model">shift.daynumber</field>
        <field name="arch" type="xml">
            <tree editable="top">
                <field name="name" />
                <field name="number" />
                <field name="active" />
            </tree>
        </field>
    </record>

    <record model="ir.ui.view" id="type_view_tree">
        <field name="name">Shift Type List</field>
        <field name="model">shift.type</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name" />
                <field name="description" />
                <field name="active" />
            </tree>
        </field>
    </record>

    <!-- Actions -->
    <record model="ir.actions.act_window" id="action_planning">
        <field name="name">Planning Action</field>
        <field name="res_model">shift.planning</field>
        <field name="view_mode">tree,form</field>
    </record>

    <record model="ir.actions.act_window" id="action_day_number">
        <field name="name">Day Number</field>
        <field name="res_model">shift.daynumber</field>
        <field name="view_mode">tree</field>
    </record>

    <record model="ir.actions.act_window" id="action_type">
        <field name="name">Shift Type</field>
        <field name="res_model">shift.type</field>
        <field name="view_mode">tree,form</field>
    </record>

</odoo>
