Skip to Content
Menu
This question has been flagged

Hi, I want to duplicate the products tree view from inventory, I've added another menu item below products but I only want 4 fields from the original product view. But the inherit tree view shows me the exact tree view with the whole information, not the 4 fields. How can I achieve that?

This is my XML code.

xml version="1.0" encoding="utf-8" ?>

id="informe_action" model="ir.actions.act_window">
name="name">Informe de inventario F983 V4
name="res_model">product.template
name="view_mode">tree


id="informe_views_tree" model="ir.ui.view">
name="name">Informe de inventario F983 V4
name="model">product.template
name="arch" type="xml">

name="name" string="Nombre de producto" optional="show"/>
name="default_code" string="Referencia" optional="show"/>
name="qty_available" string="Unidades totales" optional="show"/>
name="standard_price" string="Cosoto por unidad" optional="show"/>




id="product_brand_inventory_v2"
name="Informe de inventario F983 V4 22"
action="informe_action"
parent="stock.menu_stock_inventory_control"
sequence="2"/>
Avatar
Discard
Author

Thanks. It worked:))

Best Answer

Hi,

Try like following.

<record id="product_custom_tree_view" model="ir.ui.view">


    <field name="name">product.template.product.tree</field>


    <field name="model">product.template</field>


    <field name="arch" type="xml">


        <tree string="Product">


            <field name="name"/>


            <field name="default_code"/>


            <field name="qty_available"/>


            <field name="standard_price"/>


        </tree>


    </field>


</record>


<record id="product_custom_action" model="ir.actions.act_window">


    <field name="name">Product</field>


    <field name="res_model">product.template</field>


    <field name="view_mode">tree</field>


    <field name="view_id" ref="product_custom_tree_view"/>


</record>


<menuitem id="product_custom_menu" name="Product New" parent="stock.menu_stock_inventory_control" action="product_custom_action"/>


Regards

Avatar
Discard
Related Posts Replies Views Activity
2
Dec 22
1861
3
Aug 24
289
0
May 24
315
0
Aug 22
2138
0
Aug 21
1204