<?xml version="1.0"?>
<openerp>
    <data>
        <record id="view_account_journal_form_inherit" model="ir.ui.view">
            <field name="name">account.journal.form</field>
            <field name="model">account.journal</field>
            <field name="inherit_id" ref="account.view_account_journal_form"/>
            <field name="arch" type="xml">
                <field name="entry_posted" position="after">
                    <field name="update_posted"/>
                </field>
            </field>
        </record>

        <record id="invoice_form_cancel_inherit" model="ir.ui.view">
            <field name="name">invoice.form.cancel.inherit</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_form"/>
            <field name="arch" type="xml">
                <xpath expr="//button[@name='invoice_cancel']" position="replace">
                    <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel Invoice" groups="account.group_account_invoice"/>
                </xpath>
            </field>
        </record>

        <record id="invoice_supplier_cancel_form_inherit" model="ir.ui.view">
            <field name="name">invoice.supplier.cancel.form.inherit</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_supplier_form"/>
            <field name="arch" type="xml">
                <xpath expr="//button[@name='invoice_cancel']" position="replace">
                    <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel Invoice" groups="account.group_account_invoice"/>
                </xpath>
            </field>
        </record>

        <record id="bank_statement_cancel_form_inherit" model="ir.ui.view">
            <field name="name">bank.statement.cancel.form.inherit</field>
            <field name="model">account.bank.statement</field>
            <field name="inherit_id" ref="account.view_bank_statement_form"/>
            <field name="arch" type="xml">
                <field name="line_ids" position="attributes">
                    <attribute name="options">{'reload_on_button': true}</attribute>
                </field>
                <xpath expr="//field[@name='bank_account_id']" position="after">
                    <button name="cancel" attrs="{'invisible': [('journal_entry_id', '=', False)]}" string="Cancel" type="object" icon="gtk-undo"/>
                </xpath>
            </field>
        </record>

    </data>
</openerp>
