Trust-Code/odoo-brasil

View on GitHub
br_account_einvoice/views/account_invoice.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="view_br_account_einvoice_invoice_form" model="ir.ui.view">
        <field name="name">br_account_einvoice_invoice_form</field>
        <field name="model">account.invoice</field>
        <field name="inherit_id" ref="br_account.view_br_account_invoice_form"/>
        <field name="arch" type="xml">
            <div name="button_box" position="inside">
                <button name="action_view_edocs" type="object" class="oe_stat_button" icon="fa-file-text-o"
                    context="{ 'search_default_invoice_id': id }" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('total_edocs', '=', 0)]}">
                    <field name="total_edocs" /> <span> E-Docs</span>
                </button>
                <button name="action_preview_danfe" type="object" class="oe_stat_button" icon="fa-file-pdf-o"
                    string="Imprimir Danfe"
                    attrs="{'invisible': ['|',('state', '==', 'draft'), ('total_edocs', '=', 0)]}">
                </button>
            </div>
        </field>
    </record>

    <record id="view_br_account_einvoice_supllier_invoice_form" model="ir.ui.view">
        <field name="name">br_account_einvoice_supplier_invoice_form</field>
        <field name="model">account.invoice</field>
        <field name="inherit_id" ref="br_account.view_br_account_invoice_supplier_form"/>
        <field name="arch" type="xml">
            <div name="button_box" position="inside">
                <button name="action_view_edocs" type="object" class="oe_stat_button" icon="fa-file-text-o"
                    context="{ 'search_default_invoice_id': id }" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('total_edocs', '=', 0)]}">
                    <field name="total_edocs" /> <span> E-Docs</span>
                </button>
                <button name="action_preview_danfe" type="object" class="oe_stat_button" icon="fa-file-pdf-o"
                    string="Imprimir Danfe"
                    attrs="{'invisible': ['|',('state', '==', 'draft'), ('total_edocs', '=', 0)]}">
                </button>
            </div>
        </field>
    </record>

    <record id="view_br_account_einvoice_invoice_line_form" model="ir.ui.view">
        <field name="name">br_account_einvoice_invoice_line_form</field>
        <field name="model">account.invoice.line</field>
        <field name="inherit_id" ref="br_account.view_br_account_invoice_line_form"/>
        <field name="arch" type="xml">
            <field name="price_subtotal" position="after">
                <field name="item_pedido_compra" />
            </field>
        </field>
    </record>

    <record id="account.action_invoice_tree2" model="ir.actions.act_window">
        <field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase', 'issuer': 0}</field>
    </record>
</odoo>