<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_location_form" model="ir.ui.view">
        <field name="name">stock.location.form.vertical.lift</field>
        <field name="model">stock.location</field>
        <field name="inherit_id" ref="stock_location_tray.view_location_form" />
        <field name="arch" type="xml">
            <div name="button_box" position="inside">
                <button
                    name="button_fetch_vertical_lift_tray"
                    string="Fetch Shuttle Tray"
                    type="object"
                    groups="stock.group_stock_manager"
                    class="oe_stat_button"
                    icon="fa-hand-paper-o"
                    attrs="{'invisible': [('vertical_lift_kind', 'not in', ('tray', 'cell'))]}"
                />
                <button
                    name="button_release_vertical_lift_tray"
                    string="Release Shuttle Tray"
                    type="object"
                    groups="stock.group_stock_manager"
                    class="oe_stat_button"
                    icon="fa-hand-rock-o"
                    attrs="{'invisible': [('vertical_lift_kind', 'not in', ('tray', 'cell'))]}"
                />
            </div>
            <field name="return_location" position="after">
                <field
                    name="vertical_lift_location"
                    attrs="{'invisible': [('vertical_lift_kind', '!=', False), ('vertical_lift_kind', '!=', 'view')]}"
                />
                <field name="vertical_lift_kind" />
                <field
                    name="vertical_lift_shuttle_id"
                    attrs="{'invisible': [('vertical_lift_kind', 'not in', ('shuttle', 'tray', 'cell'))]}"
                />
            </field>
            <field name="tray_type_id" position="attributes">
                <attribute name="attrs">
                    {'invisible': [('cell_in_tray_type_id', '!=', False)],
                     'required': [('vertical_lift_kind', '=', 'tray')]}
                </attribute>
            </field>
        </field>
    </record>
    <record id="view_location_search" model="ir.ui.view">
        <field name="name">stock.location.search.vertical.lift</field>
        <field name="model">stock.location</field>
        <field name="inherit_id" ref="stock_location_tray.view_location_search" />
        <field name="arch" type="xml">
            <field name="tray_type_id" position="after">
                <field name="vertical_lift_kind" />
                <field name="vertical_lift_shuttle_id" />
            </field>
        </field>
    </record>
</odoo>
