Search code examples
odooodoo-15

Tree child can only have one of field tag,


Tree child can only have one of field tag,button, control, groupby, widget, header tag (not feild).

Odoo Server Error

Error while validating view near:

                            <tree>
                                <feild name="CustomerDetailIds">

                            </feild>

 1. Tree child can only have one of field, button, control, groupby, widget, header tag (not feild)

Code XML:

 <record id="view_tailor_detail_form" model="ir.ui.view">
        <field name="name">tailor detail form</field>
        <field name="model">tailor.data.detail</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <group>
                        <group>
                            <field name="name"/>
                            <field name="Phone"/>
                        </group>
                        <group>
                            <field name="table_no"/>
                            <field name="Catagory"/>
                            <field name="costumer_detail_id"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Customer detail">
                            <tree>
                                <feild name="CustomerDetailIds">

                            </feild>

                            <feild name="C_ids">

                            </feild>
                            <feild name="details">

                            </feild>
                            </tree>


                        </page>
                    </notebook>
                </sheet>

            </form>
        </field>
    </record>

But when I remove the tree tag it works fine but not find any output fields on UI side.


Solution

  • We can use tree tag inside a one2many or many2many field.

    In your case, you declared tree tag inside page tag. So Odoo can not find a valid field.

    So removing the tree tag will work or use it inside one2many or many2many field.

    For example:

    <field name="one2many_field">
        <tree>
            <field name="x">
            <field name="y">
        </tree>
        <form>
            <group>
                <field name="x">
                <field name="y">
            </group>
        </tree>
    </field>