<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_location_vlm_tray_form" model="ir.ui.view">
        <field name="model">stock.location.vlm.tray</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <div class="oe_button_box" name="button_box">
                        <button
                            string="Call tray"
                            class="oe_stat_button"
                            icon="fa-outdent"
                            name="action_tray_call"
                            type="object"
                        />
                        <button
                            string="Tray contents"
                            class="oe_stat_button"
                            icon="fa-table"
                            name="action_tray_content"
                            type="object"
                        />
                    </div>
                    <label for="name" class="oe_edit_only" />
                    <h1>
                        <field name="name" />
                    </h1>
                    <group>
                        <group name="info">
                            <field name="location_id" />
                            <field name="tray_type_id" />
                            <field name="is_full" invisible="1" readonly="1" />
                            <field
                                name="tray_matrix"
                                string="Tray layout"
                                widget="location_tray_matrix"
                                options="{'click_action': 'action_tray_content'}"
                                nolabel="1"
                            />
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>
    <record id="view_location_vlm_tray_tree" model="ir.ui.view">
        <field name="model">stock.location.vlm.tray</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name" />
                <field name="location_id" />
                <field name="tray_type_id" />
                <field name="is_full" invisible="1" readonly="1" />
                <field name="tray_matrix" widget="location_tray_matrix" nolabel="1" />
                <button
                    string="Call"
                    class="btn btn-secondary btn-lg"
                    icon="fa-outdent"
                    name="action_tray_call"
                    type="object"
                />
                <button
                    string="Tray inventory"
                    class="btn btn-primary btn-lg"
                    icon="fa-table"
                    name="action_tray_content"
                    type="object"
                />
            </tree>
        </field>
    </record>
    <record id="location_vlm_tray_action" model="ir.actions.act_window">
        <field name="name">Vertical Lift Module Trays</field>
        <field name="res_model">stock.location.vlm.tray</field>
        <field name="view_mode">tree,form</field>
        <field name="view_id" ref="view_location_vlm_tray_tree" />
    </record>
    <menuitem
        id="menu_vlm_config"
        parent="stock.menu_stock_config_settings"
        name="Vertical Lift Module"
    />
    <menuitem
        id="menu_vlm_config_trays"
        parent="menu_vlm_config"
        action="location_vlm_tray_action"
    />
</odoo>
