我想做一个隐形的领域 报价日期 哪个领域 日期_顺序 在销售odoo13社区。
quotation_product.xml
<xpath expr="/form/sheet/group/group/field[@name='date_order']" position="attributes">
<attribute name="invisible" attrs="{'invisible': [('state', 'in',['sale', 'done', 'cancel'])]}" >1</attribute>
</xpath>
使用上面的代码,字段是不可见的,但字段名是不可见的 报价日期 正显示在 语录 状况,我也在尝试着做隐形的 订购日期 哪个领域 日期_顺序 在 销售单 状况在销售中点击确认按钮后会显示。
解决方案:
试试下面的代码,它将永久隐藏Odoo基础字段。
<xpath expr="/form/sheet/group/group/field[@name='date_order']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
如果你想根据条件隐藏字段,请使用以下样式。
<xpath expr="/form/sheet/group/group/field[@name='date_order']" position="attributes">
<attribute name="attrs">{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}</attribute>
<!--attribute name="attrs">{'invisible': [('field_name', 'operator', condition)]}</attribute-->
</xpath>
注意:使用 invisible
属性名,用于永久隐藏和 attrs
用于基于条件的可见性
本文来自投稿,不代表运维实战侠立场,如若转载,请注明出处:https://www.shizhanxia.com/3321.html