[IMP] account_voucher: improve inherited views (make xpath match a single element)

bzr revid: rco@openerp.com-20120626120608-pt8l10aliz1moap7
This commit is contained in:
Raphael Collet 2012-06-26 14:06:08 +02:00
parent ab85adc207
commit b26723df93
1 changed files with 13 additions and 15 deletions

View File

@ -2,18 +2,18 @@
<openerp>
<data>
<record id="view_invoice_customer" model="ir.ui.view">
<field name="name">account.invoice.customer.pay</field>
<field name="model">account.invoice</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='invoice_open']" position="after">
<div>
<button name="invoice_pay_customer" type="object" string="Register Payment" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}"/>
<button name="invoice_pay_customer" type="object" string="Register Payment" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" class="oe_highlight"/>
</div>
</xpath>
</field>
<field name="name">account.invoice.customer.pay</field>
<field name="model">account.invoice</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='invoice_open'][last()]" position="after">
<button name="invoice_pay_customer" type="object" string="Register Payment"
attrs="{'invisible': ['|', ('state','!=','open'), ('sent','=',True)]}"/>
<button name="invoice_pay_customer" type="object" string="Register Payment"
attrs="{'invisible': ['|', ('state','!=','open'), ('sent','=',False)]}" class="oe_highlight"/>
</xpath>
</field>
</record>
<record id="view_invoice_supplier" model="ir.ui.view">
<field name="name">account.invoice.supplier.pay</field>
@ -21,10 +21,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='invoice_open']" position="after">
<div>
<xpath expr="//button[@name='invoice_open'][last()]" position="after">
<button name="invoice_pay_customer" type="object" string="Pay" states="open" class="oe_highlight"/>
</div>
</xpath>
</field>
</record>