我正在使用Odoo 9社區版本。在Odoo 9的銷售訂單窗體視圖中隱藏「確認銷售」按鈕
在銷售訂單有以下按鈕:
<button name="action_confirm" states="sent" string="Confirm Sale" class="btn-primary" type="object" context="{'show_sale': True}"/>
<button name="action_confirm" states="draft" string="Confirm Sale" type="object" context="{'show_sale': True}"/>
我試圖隱藏從視圖兩個按鈕。所以我嘗試了下面的代碼。
<record model="ir.ui.view" id="hide_so_confirm_button_form">
<field name="name">hide.so.confirm.button.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<button name="action_confirm" position="attributes">
<attribute name="invisible">1</attribute>
</button>
</field>
</record>
我也曾嘗試以下屬性:
<attribute name="states"></attribute>
有了上面的代碼,它只是隱藏/影響第一個按鈕。
問:
如何隱藏兩個確認銷售按鈕?