跳至內容
選單
此問題已被標幟
2 回覆
16244 瀏覽次數

Usually we add custom smart buttons by adding a position like

<xpath expr="//button[@name='%(crm.crm_lead_opportunities)d']" position="before">

Since account.invoice model does not have a smart button by default, how can I specify position of the new button

頭像
捨棄
最佳答案


<record id="record_ida" model="ir.ui.view">
<field name="name">account</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@class='oe_button_box']" position="inside">
<button name="toggle_active" type="object"
class="oe_stat_button" icon="fa-archive">
<!-- <field name="active" widget="boolean_button"-->
<!-- options='{"terminology": "archive"}'/>-->
</button>
</xpath>
</field>
</record>


頭像
捨棄
作者

It worked, Thank you for helping out a beginner.

最佳答案

Hello

<div name="button_box" position="inside">
    <button name="your_button" type="object" class="oe_stat_button" >
    </button>
</div>

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
9月 18
4883
1
8月 16
8211
2
5月 21
6713
1
1月 18
8599
0
3月 25
1009