请我需要在表单视图 external_id="sale.view_order_form" 的表“订单行”中隐藏列“描述”,如果 details==True 则隐藏此列
这是python代码:
class ClassSaleOrder(models.Model):
_inherit = 'sale.order'
details = fields.Boolean()
这是xml文件:
<record id="module_sale_order_line_form" model="ir.ui.view">
<field name="name">module.sale.order.line.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="details"/>
</xpath>
</field>
</record>