树子节点只能有字段标签、按钮、控件、groupby、小部件、标题标签之一(不能有字段)。
Odoo 服务器错误
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)
代码 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>
但是当我删除树标签时,它工作正常,但在 UI 端找不到任何输出字段。
“field”不正确,改为“field”
我们可以在 one2many 或 many2many 字段中使用 tree 标签。
在您的情况下,您在 page 标签内声明了 tree 标签。所以 Odoo 找不到有效的字段。
因此,删除 tree 标签将起作用,或者在 one2many 或 many2many 字段中使用它。
例如:
<field name="one2many_field">
<tree>
<field name="x">
<field name="y">
</tree>
<form>
<group>
<field name="x">
<field name="y">
</group>
</tree>
</field>