Odoo中文网|Odoo实施培训

标题: 关于xpath语句的应用结合已做模块小结 [打印本页]

作者: jeffrey    时间: 2018-4-17 13:13
标题: 关于xpath语句的应用结合已做模块小结
本帖最后由 jeffrey 于 2018-4-17 13:15 编辑

在is_done前加入一个字段date_deadline
<xpath expr="//field[@name]='is_done'" position="before">          <field name="date_deadline" />  
</xpath>
odoo为此提供了便捷方法:
<field name="is_done" position="before">     
    <field name="date_deadline" />  
</field>

能达到相同的效果position的属性是可选的:before,after,inside,replace,attribute

其中attribute在现已做模块中应用到,在Task表单中,我们有active字段,我们将它隐藏:
<field name= "active" position="attribute">   
    <attribute name = "invisible">1</attribute>
</field>





欢迎光临 Odoo中文网|Odoo实施培训 (http://www.chinaodoo.net/) Powered by Discuz! X3.2