[英]Change the Position of field in Xpath
我想更改 Button Refuse10 的 position 必須代替 send for payement插圖
這是本地代碼
<record id="view_expenses_form" model="ir.ui.view">
<field name="name">hr.expense.form</field>
<field name="model">hr.expense.expense</field>
<field eval="25" name="priority"/>
<field name="arch" type="xml">
<form string="Expenses Sheet">
<header>
<button name="confirm" states="draft" string="Submit to Manager" type="workflow" class="oe_highlight"/>
<button name="validate" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
<button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" groups="base.group_hr_user" />
<button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" groups="base.group_hr_user" />
<button name="done" states="accepted" string="Generate Accounting Entries" type="workflow" groups="account.group_account_invoice" class="oe_highlight"/>
<button name="action_view_move" states="done" string="Open Accounting Entries" type="object" groups="account.group_account_invoice"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,accepted,done,paid" statusbar_colors='{"confirm":"blue","cancelled":"red"}'/>
</header>
根據您的問題,首先,您需要隱藏Refuse10按鈕並在發送付款后放置相同的按鈕
注意:使用繼承視圖和 position 和 xpath。
<xpath expr="//button[@name='Refuse10 button name']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='send for payment']" position="after">
<button name="Refuse10" string="Refuse10"/>
</xpath>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.