我试图隐藏按钮,但它不起作用,为什么会这样?
<button name="%(sale_confirm_details)d" states="draft" type="action" attrs="{'invisible':[('order_confirm','=',True)]}" />
答案 0 :(得分:0)
尝试类似下面的内容
<record model="ir.ui.view" id="form_view_id_inherit">
<field name="name">model.name.form</field>
<field name="model">model.model</field>
<field name="inherit_id" ref="module_name.form_view_id"/>
<field name="arch" type="xml">
<data>
<xpath expr="//button[@name='sale_confirm_details']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</data>
</field>
</record>