跳至内容
菜单
此问题已终结

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"/>
形象
丢弃
编写者

Thanks. It worked:))

最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
2
12月 22
2877
3
8月 24
1922
0
5月 24
1517
0
8月 22
3056
0
8月 21
2109