bmya/odoo-bmya-cl

View on GitHub
l10n_cl_clean_doc_number/views/account_invoice_view.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <!-- Invoices -->

        <record id="invoice_form" model="ir.ui.view">
            <field name="name">account.invoice.form</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_form"/>
            <field name="arch" type="xml">
                <form>
                    <field name="internal_number" invisible="1"/>
                </form>
                <button name="invoice_cancel" position="after">
                    <button name="clean_internal_number" string="Clean Internal Number"  attrs="{'invisible':['|',('state','!=','cancel'),('internal_number','=',False)]}" type="object" help="Cleaning the invoice internal number will allow you to delete this invoice or to get a new number if you re-validate it. If this invoice represents a voided invoice, then you should not clean it." groups="account.group_account_manager"/>
                </button>                
            </field>
        </record>

        <record id="invoice_supplier_form" model="ir.ui.view">
            <field name="name">account.invoice.form</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_supplier_form"/>
            <field name="arch" type="xml">
                <form>
                    <field name="internal_number" invisible="1"/>
                </form>                
                <button name="invoice_cancel" position="after">
                    <button name="clean_internal_number" string="Clean Internal Number"  attrs="{'invisible':['|',('state','!=','cancel'),('internal_number','=',False)]}" type="object" help="Cleaning the invoice internal number will allow you to delete this invoice or to get a new number if you re-validate it. If this invoice represents a voided invoice, then you should not clean it." groups="account.group_account_manager"/>
                </button>                
            </field>
        </record>

    </data>
</openerp>