<commit_before><?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <!-- Invoices -->
        <record id="view_invoice_line_calendar" model="ir.ui.view">
            <field name="name">account.invoice.calendar</field>
            <field name="model">account.invoice</field>
            <field name="arch" type="xml">
                <calendar string="Invoices" color="journal_id" date_start="date_invoice">
                    <field name="partner_id"/>
                    <field name="amount_total"/>
                </calendar>
            </field>
        </record>

        <record model="ir.ui.view" id="view_invoice_graph">
            <field name="name">account.invoice.graph</field>
            <field name="model">account.invoice</field>
            <field name="arch" type="xml">
                <graph string="Invoices" type="bar">
                    <field name="partner_id"/>
                    <field name="amount_total" operator="+"/>
                </graph>
            </field>
        </record>

        <record id="view_invoice_line_tree" model="ir.ui.view">
            <field name="name">account.invoice.line.tree</field>
            <field name="model">account.invoice.line</field>
            <field name="arch" type="xml">
                <tree string="Invoice Line">
                    <field name="name"/>
                    <field name="account_id" groups="account.group_account_user"/>
                    <field name="quantity"/>
                    <field name="uos_id" groups="product.group_uom"/>
                    <field name="price_unit"/>
                    <field name="discount" groups="sale.group_discount_per_so_line"/>
                    <field name="price_subtotal"/>
                </tree>
            </field>
        </record>

        <record id="view_invoice_line_form" model="ir.ui.view">
            <field name="name">account.invoice.line.form</field>
            <field name="model">account.invoice.line</field>
            <field name="arch" type="xml">
                <form string="Invoice Line" version="7.0">
                    <group>
                        <group>
                            <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                            <label for="quantity"/>
                            <div>
                                <field name="quantity" class="oe_inline"/>
                                <field name="uos_id" class="oe_inline" groups="product.group_uom"
                                  on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                            </div>
                            <field name="price_unit"/>
                            <field name="discount" groups="sale.group_discount_per_so_line"/>
                        </group>
                        <group>
                            <field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)" groups="account.group_account_user"/>
                            <field name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]" widget="many2many_tags"/>
                            <field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
                            <field name="company_id" groups="base.group_multi_company" readonly="1"/>
                        </group>
                    </group>
                    <label for="name"/>
                    <field name="name"/>
                </form>
            </field>
        </record>

        <record id="view_invoice_tax_tree" model="ir.ui.view">
            <field name="name">account.invoice.tax.tree</field>
            <field name="model">account.invoice.tax</field>
            <field name="arch" type="xml">
                <tree string="Manual Invoice Taxes">
                    <field name="sequence"/>
                    <field name="manual"/>
                    <field name="name"/>
                    <field name="account_id" groups="base.group_account_user"/>
                    <field name="base"/>
                    <field name="amount"/>
                </tree>
            </field>
        </record>

        <record id="view_invoice_tax_form" model="ir.ui.view">
            <field name="name">account.invoice.tax.form</field>
            <field name="model">account.invoice.tax</field>
            <field name="arch" type="xml">
                <form string="Manual Invoice Taxes" version="7.0">
                    <group col="4">
                        <field name="name"/>
                        <field name="sequence"/>
                        <field name="account_id" groups="account.group_account_user"/>
                        <field name="account_analytic_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
                        <field name="manual"/>
                        <field name="amount"/>
                        <field name="base" readonly="0"/>
                        <separator colspan="4" string="Tax Codes"/>
                        <field name="base_code_id"/>
                        <field name="base_amount"/>
                        <field name="tax_code_id"/>
                        <field name="tax_amount"/>
                        <field name="factor_base" invisible="True"/>
                        <field name="factor_tax" invisible="True"/>
                    </group>
                </form>
            </field>
        </record>

        <record id="invoice_tree" model="ir.ui.view">
            <field name="name">account.invoice.tree</field>
            <field name="model">account.invoice</field>
            <field name="arch" type="xml">
                <tree colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel'" string="Invoice">
                    <field name="partner_id" groups="base.group_user"/>
                    <field name="date_invoice"/>
                    <field name="number"/>
                    <field name="reference" invisible="1"/>
                    <field name="name" invisible="1"/>
                    <field name="journal_id" invisible="1"/>
                    <field name="period_id" invisible="1" groups="account.group_account_user"/>
                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                    <field name="user_id"/>
                    <field name="date_due"/>
                    <field name="origin"/>
                    <field name="currency_id" groups="base.group_multi_currency"/>
                    <field name="residual" sum="Residual Amount"/>
                    <field name="amount_untaxed" sum="Untaxed Amount"/>
                    <field name="amount_total" sum="Total Amount"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>

        <record id="invoice_supplier_form" model="ir.ui.view">
            <field name="name">account.invoice.supplier.form</field>
            <field name="model">account.invoice</field>
            <field name="priority">2</field>
            <field name="arch" type="xml">
                <form string="Supplier Invoice" version="7.0">
                <header>
                        <button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_highlight" groups="account.group_account_invoice"/>
                        <button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid' groups="account.group_account_invoice"/>
                        <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
                        <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" groups="account.group_account_invoice"/>
                        <button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
                    <field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
                </header>
                <sheet string="Supplier Invoice">
                    <div class="oe_title">
                        <h1>
                            <label string="Draft Invoice" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_invoice')]}"/>
                            <label string="Draft Refund" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_refund')]}"/>
                            <label string="Invoice" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_invoice')]}"/>
                            <label string="Refund" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_refund')]}"/>
                            <field name="number" class="oe_inline"  attrs="{'invisible': [('state', '=', 'draft')]}"/>
                        </h1>
                    </div>
                    <field name="type" invisible="1"/>
                    <group>
                        <group>
                            <field string="Supplier" name="partner_id"
                              on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
                              context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
                              domain="[('supplier', '=', True)]"/>
                            <field name="fiscal_position" widget="selection"/>
                            <field name="origin"/>
                            <field name="supplier_invoice_number"/>
                            <label for="reference_type"/>
                            <div>
                                <field name="reference_type" class="oe_inline oe_edit_only"/>
                                <field name="reference" class="oe_inline"/>
                            </div>
                        </group>
                        <group>
                            <field name="date_invoice"/>
                            <field name="date_due"/>
                            <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"
                                name="account_id" groups="account.group_account_user"/>
                            <field name="journal_id" groups="account.group_account_user"
                                on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
                            <field name="currency_id" groups="base.group_multi_currency"/>
                            <field name="check_total" groups="account.group_supplier_inv_check_total"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Invoice">
                            <field context="{'partner_id': partner_id, 'price_type': context.get('price_type') or False, 'type': type}" name="invoice_line">
                                <tree string="Invoice lines" editable="bottom">
                                    <field name="product_id"
                                        on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                                    <field name="name"/>
                                    <field name="company_id" groups="base.group_multi_company" readonly="1"/>
                                    <field name="account_id" groups="account.group_account_user"
                                        domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
                                        on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
                                    <field name="account_analytic_id" groups="analytic.group_analytic_accounting"
                                        domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
                                    <field name="quantity"/>
                                    <field name="uos_id" groups="product.group_uom"
                                        on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                                    <field name="price_unit"/>
                                    <field name="discount" groups="sale.group_discount_per_so_line"/>
                                    <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
                                        domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
                                    <field name="price_subtotal"/>
                                </tree>
                            </field>
                            <group class="oe_subtotal_footer oe_right">
                                <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                <div>
                                    <label for="amount_tax"/>
                                    <button name="button_reset_taxes" states="draft,proforma2"
                                        string="(update)" class="oe_link oe_edit_only"
                                        type="object" help="Recompute taxes and total"/>
                                </div>
                                <field name="amount_tax" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                <field name="amount_total" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>

                                <field name="residual" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                <field name="reconciled" invisible="1"/>
                            </group>
                            <div style="width: 50%%">
                                <field name="tax_line">
                                    <tree editable="bottom" string="Taxes">
                                        <field name="name"/>
                                        <field name="account_id" groups="account.group_account_invoice"/>
                                        <field name="account_analytic_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
                                        <field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
                                        <field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>

                                        <field invisible="True" name="base_amount"/>
                                        <field invisible="True" name="tax_amount"/>
                                        <field name="factor_base" invisible="True"/>
                                        <field name="factor_tax" invisible="True"/>
                                    </tree>
                                </field>
                            </div>
                            <div class="oe_clear">
                                <label for="comment"/>
                            </div>
                            <field name="comment"/>
                        </page>
                        <page string="Other Info">
                            <group>
                                <group>
                                    <field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>
                                    <field name="user_id"/>
                                    <field name="name" invisible="1"/>
                                    <field name="payment_term" widget="selection"/>
                                </group>
                                <group>
                                    <field name="move_id" groups="account.group_account_user"/>
                                    <field name="period_id" domain="[('state', '=', 'draft')]" groups="account.group_account_user" widget="selection"/>
                                    <field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
                                </group>
                            </group>
                        </page>
                        <page string="Payments">
                            <field name="payment_ids">
                                <tree string="Payments">
                                    <field name="date" string="Payment Date"/>
                                    <field name="move_id"/>
                                    <field name="ref"/>
                                    <field name="name"/>
                                    <field name="journal_id"/>
                                    <field name="debit"/>
                                    <field name="credit"/>
                                    <field name="amount_currency"/>
                                    <field name="currency_id" groups="base.group_multi_currency"/>
                                </tree>
                            </field>
                        </page>
                    </notebook>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
                </form>
            </field>
        </record>

        <record id="invoice_form" model="ir.ui.view">
            <field name="name">account.invoice.form</field>
            <field name="model">account.invoice</field>
            <field name="arch" type="xml">
                <form string="Invoice" version="7.0">
                <header>
                    <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
                    <button name="invoice_print" string="Print" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
                    <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
                    <button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
                    <button name="invoice_open" states="draft" string="Validate" class="oe_highlight" groups="base.group_user"/>
                    <button name="invoice_open" states="proforma2" string="Validate" groups="base.group_user"/>
                    <button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
                    <button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='open,proforma2,paid' groups="base.group_user"/>
                    <button name="invoice_cancel" states="draft,proforma2,open" string="Cancel" groups="base.group_no_one"/>
                    <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" groups="base.group_user"/>
                    <button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
                    <!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->
                    <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
                </header>
                <sheet string="Invoice">
                    <h1>
                        <label string="Draft Invoice " attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_invoice')]}"/>
                        <label string="Draft Refund " attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_refund')]}"/>
                        <label string="Pro Forma Invoice " attrs="{'invisible': [('state','not in',('proforma','proforma2'))]}"/>
                        <label string="Invoice " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_invoice')]}"/>
                        <label string="Refund " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_refund')]}"/>
                        <field name="number" readonly="1" class="oe_inline"/>
                    </h1>
                    <field name="type" invisible="1"/>
                    <group>
                        <group>
                            <field string="Customer" name="partner_id"
                                on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
                                groups="base.group_user" context="{'search_default_customer':1, 'show_address': 1}"
                                options='{"always_reload": True}'/>
                            <field name="fiscal_position" widget="selection" />
                        </group>
                        <group>
                            <field name="date_invoice"/>
                            <field name="journal_id" groups="account.group_account_user"
                                on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
                            <field domain="[('company_id', '=', company_id),('type','=', 'receivable')]"
                                name="account_id" groups="account.group_account_user"/>

                            <label for="currency_id" groups="base.group_multi_currency"/>
                            <div groups="base.group_multi_currency">
                                <field name="currency_id" class="oe_inline"/>
                                <!-- note fp: I don't think we need this feature ?
                                <button name="%(action_account_change_currency)d" type="action"
                                  icon="terp-stock_effects-object-colorize"
                                  attrs="{'invisible':[('state','!=','draft')]}"
                                  groups="account.group_account_user"/> -->
                            </div>
                        </group>
                    </group>
                    <field name="sent" invisible="1"/>
                    <notebook colspan="4">
                        <page string="Invoice Lines">
                            <field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}">
                                <tree string="Invoice Lines" editable="bottom">
                                    <field name="product_id"
                                        on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                                    <field name="name"/>
                                    <field name="company_id" groups="base.group_multi_company" readonly="1"/>
                                    <field name="account_id" groups="account.group_account_user"
                                        domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
                                        on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
                                    <field name="account_analytic_id" groups="analytic.group_analytic_accounting"
                                        domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
                                    <field name="quantity"/>
                                    <field name="uos_id" groups="product.group_uom"
                                        on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                                    <field name="price_unit"/>
                                    <field name="discount" groups="sale.group_discount_per_so_line"/>
                                    <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
                                        domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
                                    <field name="price_subtotal"/>
                                </tree>
                            </field>
                            <group class="oe_subtotal_footer oe_right">
                                <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                <div>
                                    <label for="amount_tax"/>
                                    <button name="button_reset_taxes" states="draft,proforma2"
                                        string="(update)" class="oe_link oe_edit_only"<commit_msg>[IMP] company_id invisible on invocie line<commit_after><?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <!-- Invoices -->
        <record id="view_invoice_line_calendar" model="ir.ui.view">
            <field name="name">account.invoice.calendar</field>
            <field name="model">account.invoice</field>
            <field name="arch" type="xml">
                <calendar string="Invoices" color="journal_id" date_start="date_invoice">
                    <field name="partner_id"/>
                    <field name="amount_total"/>
                </calendar>
            </field>
        </record>

        <record model="ir.ui.view" id="view_invoice_graph">
            <field name="name">account.invoice.graph</field>
            <field name="model">account.invoice</field>
            <field name="arch" type="xml">
                <graph string="Invoices" type="bar">
                    <field name="partner_id"/>
                    <field name="amount_total" operator="+"/>
                </graph>
            </field>
        </record>

        <record id="view_invoice_line_tree" model="ir.ui.view">
            <field name="name">account.invoice.line.tree</field>
            <field name="model">account.invoice.line</field>
            <field name="arch" type="xml">
                <tree string="Invoice Line">
                    <field name="name"/>
                    <field name="account_id" groups="account.group_account_user"/>
                    <field name="quantity"/>
                    <field name="uos_id" groups="product.group_uom"/>
                    <field name="price_unit"/>
                    <field name="discount" groups="sale.group_discount_per_so_line"/>
                    <field name="price_subtotal"/>
                </tree>
            </field>
        </record>

        <record id="view_invoice_line_form" model="ir.ui.view">
            <field name="name">account.invoice.line.form</field>
            <field name="model">account.invoice.line</field>
            <field name="arch" type="xml">
                <form string="Invoice Line" version="7.0">
                    <group>
                        <group>
                            <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                            <label for="quantity"/>
                            <div>
                                <field name="quantity" class="oe_inline"/>
                                <field name="uos_id" class="oe_inline" groups="product.group_uom"
                                  on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                            </div>
                            <field name="price_unit"/>
                            <field name="discount" groups="sale.group_discount_per_so_line"/>
                        </group>
                        <group>
                            <field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)" groups="account.group_account_user"/>
                            <field name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]" widget="many2many_tags"/>
                            <field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
                            <field name="company_id" groups="base.group_multi_company" readonly="1"/>
                        </group>
                    </group>
                    <label for="name"/>
                    <field name="name"/>
                </form>
            </field>
        </record>

        <record id="view_invoice_tax_tree" model="ir.ui.view">
            <field name="name">account.invoice.tax.tree</field>
            <field name="model">account.invoice.tax</field>
            <field name="arch" type="xml">
                <tree string="Manual Invoice Taxes">
                    <field name="sequence"/>
                    <field name="manual"/>
                    <field name="name"/>
                    <field name="account_id" groups="base.group_account_user"/>
                    <field name="base"/>
                    <field name="amount"/>
                </tree>
            </field>
        </record>

        <record id="view_invoice_tax_form" model="ir.ui.view">
            <field name="name">account.invoice.tax.form</field>
            <field name="model">account.invoice.tax</field>
            <field name="arch" type="xml">
                <form string="Manual Invoice Taxes" version="7.0">
                    <group col="4">
                        <field name="name"/>
                        <field name="sequence"/>
                        <field name="account_id" groups="account.group_account_user"/>
                        <field name="account_analytic_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
                        <field name="manual"/>
                        <field name="amount"/>
                        <field name="base" readonly="0"/>
                        <separator colspan="4" string="Tax Codes"/>
                        <field name="base_code_id"/>
                        <field name="base_amount"/>
                        <field name="tax_code_id"/>
                        <field name="tax_amount"/>
                        <field name="factor_base" invisible="True"/>
                        <field name="factor_tax" invisible="True"/>
                    </group>
                </form>
            </field>
        </record>

        <record id="invoice_tree" model="ir.ui.view">
            <field name="name">account.invoice.tree</field>
            <field name="model">account.invoice</field>
            <field name="arch" type="xml">
                <tree colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel'" string="Invoice">
                    <field name="partner_id" groups="base.group_user"/>
                    <field name="date_invoice"/>
                    <field name="number"/>
                    <field name="reference" invisible="1"/>
                    <field name="name" invisible="1"/>
                    <field name="journal_id" invisible="1"/>
                    <field name="period_id" invisible="1" groups="account.group_account_user"/>
                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                    <field name="user_id"/>
                    <field name="date_due"/>
                    <field name="origin"/>
                    <field name="currency_id" groups="base.group_multi_currency"/>
                    <field name="residual" sum="Residual Amount"/>
                    <field name="amount_untaxed" sum="Untaxed Amount"/>
                    <field name="amount_total" sum="Total Amount"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>

        <record id="invoice_supplier_form" model="ir.ui.view">
            <field name="name">account.invoice.supplier.form</field>
            <field name="model">account.invoice</field>
            <field name="priority">2</field>
            <field name="arch" type="xml">
                <form string="Supplier Invoice" version="7.0">
                <header>
                        <button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_highlight" groups="account.group_account_invoice"/>
                        <button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid' groups="account.group_account_invoice"/>
                        <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
                        <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" groups="account.group_account_invoice"/>
                        <button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
                    <field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
                </header>
                <sheet string="Supplier Invoice">
                    <div class="oe_title">
                        <h1>
                            <label string="Draft Invoice" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_invoice')]}"/>
                            <label string="Draft Refund" attrs="{'invisible': ['|',('state','&lt;&gt;','draft'), ('type','&lt;&gt;','in_refund')]}"/>
                            <label string="Invoice" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_invoice')]}"/>
                            <label string="Refund" attrs="{'invisible': ['|',('state', '=', 'draft'), ('type','&lt;&gt;','in_refund')]}"/>
                            <field name="number" class="oe_inline"  attrs="{'invisible': [('state', '=', 'draft')]}"/>
                        </h1>
                    </div>
                    <field name="type" invisible="1"/>
                    <group>
                        <group>
                            <field string="Supplier" name="partner_id"
                              on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
                              context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
                              domain="[('supplier', '=', True)]"/>
                            <field name="fiscal_position" widget="selection"/>
                            <field name="origin"/>
                            <field name="supplier_invoice_number"/>
                            <label for="reference_type"/>
                            <div>
                                <field name="reference_type" class="oe_inline oe_edit_only"/>
                                <field name="reference" class="oe_inline"/>
                            </div>
                        </group>
                        <group>
                            <field name="date_invoice"/>
                            <field name="date_due"/>
                            <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"
                                name="account_id" groups="account.group_account_user"/>
                            <field name="journal_id" groups="account.group_account_user"
                                on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
                            <field name="currency_id" groups="base.group_multi_currency"/>
                            <field name="check_total" groups="account.group_supplier_inv_check_total"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Invoice">
                            <field context="{'partner_id': partner_id, 'price_type': context.get('price_type') or False, 'type': type}" name="invoice_line">
                                <tree string="Invoice lines" editable="bottom">
                                    <field name="product_id"
                                        on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                                    <field name="name"/>
                                    <field name="company_id" invisible="1"/>
                                    <field name="account_id" groups="account.group_account_user"
                                        domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
                                        on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
                                    <field name="account_analytic_id" groups="analytic.group_analytic_accounting"
                                        domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
                                    <field name="quantity"/>
                                    <field name="uos_id" groups="product.group_uom"
                                        on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                                    <field name="price_unit"/>
                                    <field name="discount" groups="sale.group_discount_per_so_line"/>
                                    <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
                                        domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
                                    <field name="price_subtotal"/>
                                </tree>
                            </field>
                            <group class="oe_subtotal_footer oe_right">
                                <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                <div>
                                    <label for="amount_tax"/>
                                    <button name="button_reset_taxes" states="draft,proforma2"
                                        string="(update)" class="oe_link oe_edit_only"
                                        type="object" help="Recompute taxes and total"/>
                                </div>
                                <field name="amount_tax" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                <field name="amount_total" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>

                                <field name="residual" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                <field name="reconciled" invisible="1"/>
                            </group>
                            <div style="width: 50%%">
                                <field name="tax_line">
                                    <tree editable="bottom" string="Taxes">
                                        <field name="name"/>
                                        <field name="account_id" groups="account.group_account_invoice"/>
                                        <field name="account_analytic_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
                                        <field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
                                        <field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>

                                        <field invisible="True" name="base_amount"/>
                                        <field invisible="True" name="tax_amount"/>
                                        <field name="factor_base" invisible="True"/>
                                        <field name="factor_tax" invisible="True"/>
                                    </tree>
                                </field>
                            </div>
                            <div class="oe_clear">
                                <label for="comment"/>
                            </div>
                            <field name="comment"/>
                        </page>
                        <page string="Other Info">
                            <group>
                                <group>
                                    <field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>
                                    <field name="user_id"/>
                                    <field name="name" invisible="1"/>
                                    <field name="payment_term" widget="selection"/>
                                </group>
                                <group>
                                    <field name="move_id" groups="account.group_account_user"/>
                                    <field name="period_id" domain="[('state', '=', 'draft')]" groups="account.group_account_user" widget="selection"/>
                                    <field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
                                </group>
                            </group>
                        </page>
                        <page string="Payments">
                            <field name="payment_ids">
                                <tree string="Payments">
                                    <field name="date" string="Payment Date"/>
                                    <field name="move_id"/>
                                    <field name="ref"/>
                                    <field name="name"/>
                                    <field name="journal_id"/>
                                    <field name="debit"/>
                                    <field name="credit"/>
                                    <field name="amount_currency"/>
                                    <field name="currency_id" groups="base.group_multi_currency"/>
                                </tree>
                            </field>
                        </page>
                    </notebook>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
                </form>
            </field>
        </record>

        <record id="invoice_form" model="ir.ui.view">
            <field name="name">account.invoice.form</field>
            <field name="model">account.invoice</field>
            <field name="arch" type="xml">
                <form string="Invoice" version="7.0">
                <header>
                    <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
                    <button name="invoice_print" string="Print" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
                    <button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
                    <button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
                    <button name="invoice_open" states="draft" string="Validate" class="oe_highlight" groups="base.group_user"/>
                    <button name="invoice_open" states="proforma2" string="Validate" groups="base.group_user"/>
                    <button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
                    <button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='open,proforma2,paid' groups="base.group_user"/>
                    <button name="invoice_cancel" states="draft,proforma2,open" string="Cancel" groups="base.group_no_one"/>
                    <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" groups="base.group_user"/>
                    <button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
                    <!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->
                    <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
                </header>
                <sheet string="Invoice">
                    <h1>
                        <label string="Draft Invoice " attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_invoice')]}"/>
                        <label string="Draft Refund " attrs="{'invisible': ['|',('state','not in',('draft',)), ('type','&lt;&gt;','out_refund')]}"/>
                        <label string="Pro Forma Invoice " attrs="{'invisible': [('state','not in',('proforma','proforma2'))]}"/>
                        <label string="Invoice " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_invoice')]}"/>
                        <label string="Refund " attrs="{'invisible': ['|',('state','in',('draft','proforma','proforma2')), ('type','&lt;&gt;','out_refund')]}"/>
                        <field name="number" readonly="1" class="oe_inline"/>
                    </h1>
                    <field name="type" invisible="1"/>
                    <group>
                        <group>
                            <field string="Customer" name="partner_id"
                                on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
                                groups="base.group_user" context="{'search_default_customer':1, 'show_address': 1}"
                                options='{"always_reload": True}'/>
                            <field name="fiscal_position" widget="selection" />
                        </group>
                        <group>
                            <field name="date_invoice"/>
                            <field name="journal_id" groups="account.group_account_user"
                                on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
                            <field domain="[('company_id', '=', company_id),('type','=', 'receivable')]"
                                name="account_id" groups="account.group_account_user"/>

                            <label for="currency_id" groups="base.group_multi_currency"/>
                            <div groups="base.group_multi_currency">
                                <field name="currency_id" class="oe_inline"/>
                                <!-- note fp: I don't think we need this feature ?
                                <button name="%(action_account_change_currency)d" type="action"
                                  icon="terp-stock_effects-object-colorize"
                                  attrs="{'invisible':[('state','!=','draft')]}"
                                  groups="account.group_account_user"/> -->
                            </div>
                        </group>
                    </group>
                    <field name="sent" invisible="1"/>
                    <notebook colspan="4">
                        <page string="Invoice Lines">
                            <field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}">
                                <tree string="Invoice Lines" editable="bottom">
                                    <field name="product_id"
                                        on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                                    <field name="name"/>
                                    <field name="company_id" invisible="1"/>
                                    <field name="account_id" groups="account.group_account_user"
                                        domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
                                        on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
                                    <field name="account_analytic_id" groups="analytic.group_analytic_accounting"
                                        domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
                                    <field name="quantity"/>
                                    <field name="uos_id" groups="product.group_uom"
                                        on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
                                    <field name="price_unit"/>
                                    <field name="discount" groups="sale.group_discount_per_so_line"/>
                                    <field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
                                        domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
                                    <field name="price_subtotal"/>
                                </tree>
                            </field>
                            <group class="oe_subtotal_footer oe_right">
                                <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                <div>
                                    <label for="amount_tax"/>
                                    <button name="button_reset_taxes" states="draft,proforma2"
                                        string="(update)" class="oe_link oe_edit_only"
{'fraction_non_alphanumeric': 0.14391560969483863, 'fraction_numerical': 0.0022604546025367326, 'mean_word_length': 1.6308287710024543, 'pattern_counts': {'":': 10, '<': 705, '<?xml version=': 2, '>': 703, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 20}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 146, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7574797', 'n_tokens_mistral': 14338, 'n_tokens_neox': 13700, 'n_words': 2434}