Search code examples
odooodoo-8odoo-9

Tree view by default in Inventory


In Sales when I go to Product menu I get tree view by default. I did it like this

<record id="product.product_normal_action_sell" model="ir.actions.act_window">
            <field name="view_mode">tree,form,kanban</field>
        </record>
        <record id="product.product_template_action" model="ir.actions.act_window">
            <field name="view_mode">tree,form,kanban</field>
            <field name="view_id" ref="product.product_template_tree_view"/>
        </record>

Same in Purchase and Manufacturing but I have a problem to do the same in Inventory.

This is an original menu that calls an action

<menuitem
            action="product.product_template_action_product" id="menu_product_variant_config_stock" name="Products"
            parent="stock.menu_stock_inventory_control" sequence="1"/>

how can I make it that when I go to Inventory->Products tree view opens by default


Solution

  • Actually, it's the same. you need to add

      <record id="product.product_template_action_product" model="ir.actions.act_window">
                <field name="view_mode">tree,form,kanban</field>
            </record>
    

    to Product view