开发者

Specify display mode of one2many field in an OpenERP form view

开发者 https://www.devze.com 2023-02-04 20:36 出处:网络
there is a field one2many...when i tried to open the view of that field it shows tree view but i want the fo开发者_开发技巧rm view..and want to disable the tree view.

there is a field one2many...when i tried to open the view of that field it shows tree view but i want the fo开发者_开发技巧rm view..and want to disable the tree view.

is there any solution?


On a one2many field, you can specify which display modes to use for the child view. The developer book gives a brief description of the mode attribute, and you can find an example on the Partner view's address field:

<record id="view_partner_form" model="ir.ui.view">
    <field name="name">res.partner.form</field>
    <field name="model">res.partner</field>
    <field name="type">form</field>
    <field name="arch" type="xml">
        <form string="Partners">
            <group colspan="4" col="6">
                ...
            </group>
            <notebook colspan="4">
                <page string="General">
                    <field 
                        colspan="4" 
                        mode="form,tree" 
                        name="address" 
                        nolabel="1" 
                        select="1">
                        <form string="Partner Contacts">
                            <field name="name" select="2"/>
                            <field name="function"/>
                            <field name="type" select="2"/>
                            ...

This example is from server/bin/addons/base/res/partner/partner_view.xml. It sounds like you want to use mode="form" for your field.

0

精彩评论

暂无评论...
验证码 换一张
取 消