方法一:
<attribute name="invisible"></attribute>,按这种方式可以将原属性 invisible 删除.
<!-- 显示明细的位置信息 -->
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='location_id']" position="attributes">
<!--<field name="location_id" attrs="{'column_invisible':[('parent.picking_type_code','!=','outgoing')]}"/>-->
<attribute name="invisible"></attribute>
<attribute name="attrs">{'column_invisible':[('parent.picking_type_code','!=','outgoing')]}</attribute>
</xpath>
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='location_dest_id']" position="attributes">
<!--<field name="location_dest_id" attrs="{'column_invisible':[('parent.picking_type_code','!=','incoming')]}"/>-->
<attribute name="invisible"></attribute>
<attribute name="attrs">{'column_invisible':[('parent.picking_type_code','!=','incoming')]}</attribute>
</xpath>
方法二:
将原生的节点替换:
<!-- 显示明细的位置信息 -->
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='location_id']" position="replace">
<field name="location_id" attrs="{'column_invisible':[('parent.picking_type_code','not in',['outgoing','internal'])]}"/>
</xpath>
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='location_dest_id']" position="replace">
<field name="location_dest_id" attrs="{'column_invisible':[('parent.picking_type_code','not in',['incoming',internal'])]}"/>
</xpath>