<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="rma_product_product_tree_view" model="ir.ui.view">
            <field name="name">product.stock.tree.inherit</field>
            <field name="model">product.product</field>
            <field name="arch" type="xml">
                <tree string="Product Variants" create="false">
                    <field name="default_code"/>
                    <field name="name"/>
                    <field name="attribute_value_ids" widget="many2many_tags"/>
                    <field name="rma_qty_available"/>
                    <field name="rma_virtual_available"/>
                </tree>
            </field>
        </record>

        <record id="rma_product_search_view" model="ir.ui.view">
            <field name="name">product.product.search</field>
            <field name="model">product.product</field>
            <field name="arch" type="xml">
                <search string="RMA Products">
                    <separator/>
                    <filter name="rma_available" string="RMA Available Products"
                        domain="['|', ('rma_qty_available','&gt;',0), ('rma_virtual_available','&gt;',0)]"/>
                </search>
            </field>
        </record>

        <record id="rma_product_variant_action" model="ir.actions.act_window">
            <field name="name">RMA Stock</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.product</field>
            <field name="view_mode">tree</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="rma_product_product_tree_view"/>
            <field name="search_view_id" ref="rma_product_search_view"/>
            <field name="context">{'search_default_rma_available': 1}</field>
        </record>

        <menuitem action="rma_product_variant_action"
            id="menu_stock_rma" parent="base.menu_aftersale"
            name="RMA Stock"
            sequence="100"/>
    </data>
</openerp>
