【问题标题】:How to hide field by inheritance in Odoo10如何在 Odoo10 中通过继承隐藏字段
【发布时间】:2018-10-10 11:51:32
【问题描述】:

我试图通过继承隐藏库存“发票政策”中的字段,但我在终端上遇到错误,当我隐藏此组时,它也显示错误“ValueError:元素''不能位于父级查看”。

我的代码如下:

<record model="ir.ui.view" id="inventory_rental_order_form">
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="name">Inventory Rental Form</field>
<field name="model">product.template</field>
<field name="arch" type="xml">
    <data>
        <xpath expr="//notebook/page[@name='invoicing']/group[2]" position="replace" invisible="1">
        </xpath>
        <xpath expr="//field[@name='invoice_policy']" position="replace" invisible="1">
        </xpath>
    </data>
</field>

提前致谢

【问题讨论】:

标签: xml odoo odoo-10 inventory


【解决方案1】:

这样试试

 <data>
    <xpath expr="//notebook/page[@name='invoicing']/group[2]" position="attributes">
       <attribute name="invisible">1</attribute>
     </xpath>
     <xpath expr="//field[@name='invoice_policy']" position="attributes">
         <attribute name="invisible">1</attribute>
     </xpath>
 </data>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-28
    • 1970-01-01
    • 2019-06-16
    • 2015-07-15
    • 1970-01-01
    • 2016-08-27
    • 1970-01-01
    • 2018-07-18
    相关资源
    最近更新 更多