1 回答

TA貢獻1906條經驗 獲得超10個贊
您必須在標題級別顯示字段來處理這些。
就像在聲明按鈕之前執行以下代碼一樣。
<field name='hide_invoice' invisible='1'/>
并將其刪除在 partner_id 字段之前。
編輯
您可以嘗試使用以下 xml 代碼:
<record id="sale_order_view_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='sale_pay']/field[@name='invoice_status']" position="attributes">
<attribute name="invisible" eval="False"/>
</xpath>
<xpath expr="//button[@name='action_quotation_send']" position="before">
<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" class="btn-primary"
attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"/>
<field name="hide_invoice" invisible="1"/>
<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" context="{'default_advance_payment_method': 'percentage'}"
attrs="{'invisible': ['|','|',('hide_invoice', '=', True),('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
</xpath>
</field>
</record>
添加回答
舉報