[IMP] search view: review of the search views.
[odoo/odoo.git] / addons / account_voucher / account_voucher_pay_invoice.xml
index 688393d..c6128c4 100644 (file)
@@ -2,15 +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">
-           <button name="invoice_open" position="after">
-               <button name="invoice_pay_customer" type="object" class="oe_form_button_active_flow" string="Register Payment" states="open" icon="gtk-go-forward"/>
-           </button>
-           </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>
@@ -18,9 +21,9 @@
             <field name="type">form</field>
             <field name="inherit_id" ref="account.invoice_supplier_form"/>
             <field name="arch" type="xml">
-                <button name="invoice_open" position="after">
-                    <button name="invoice_pay_customer" type="object" string="Pay" states="open" icon="gtk-go-forward"/>
-                </button>
+                <xpath expr="//button[@name='invoice_open'][last()]" position="after">
+                    <button name="invoice_pay_customer" type="object" string="Pay" states="open" class="oe_highlight"/>
+                </xpath>
             </field>
         </record>
     </data>