Tha*_*bir 2 xpath odoo odoo-12
销售订单中有两个按钮同名
<button name="action_confirm" id="action_confirm"
string="Confirm" class="btn-primary" type="object"
attrs="{'invisible': [('state', 'not in', ['sent'])]}"/>
**<button name="action_confirm"
string="Confirm" type="object"
attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>**
Run Code Online (Sandbox Code Playgroud)
需要使用 xpath 选择第二个按钮并更改其属性
在这里试试这个:
<!-- make priority bigger to make sure that this XPATH is used after the one
that adds the button -->
<field eval="100" name="priority"/>
<field name="arch" type="xml">
<xpath expr='//buttion[@name="action_confirm"][2]' position='replace'/>
</field>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
872 次 |
最近记录: |