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

<odoo>

        <!-- VIEW FOR THE OBJECT : account_invoice_line -->
        <record id="view_account_invoice_line_form" model="ir.ui.view">
            <field name="model">account.invoice.line</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="account.view_invoice_line_form" />
            <field name="arch" type="xml">
                <xpath expr="//label[@for='name']" position="before">
                    <notebook>
                        <page name="subcontractor_information"
                               string="Subcontractor Information"
                               attrs="{'invisible': [('subcontracted','=', False)]}">
                            <field name="subcontracted" invisible="1"/>
                            <field name="subcontractor_work_invoiced_id"
                                   groups="account_invoice_subcontractor.group_is_subcontractor"/>
                            <field name="invalid_work_amount" invisible="1"/>
                            <field name="subcontractor_work_ids"
                                   groups="account_invoice_subcontractor.group_have_subcontractor"
                                   nolabel="1">
                                <tree string="Subcontractor work" editable="bottom">
                                    <field name="employee_id"/>
                                    <field name="subcontractor_type" invisible="True"/>
                                    <field name="quantity" sum="Total Qty"/>
                                    <field name="uom_id"/>
                                    <field name="cost_price_unit"/>
                                    <field name="sale_price_unit"/>
                                    <field name="sale_price" sum="Total Sale Amount"/>
                                    <field name="cost_price" sum="Total Cost Amount"/>
                               </tree>
                            </field>
                        </page>
                    </notebook>
                </xpath>
            </field>
        </record>

        <record id="view_invoice_form" model="ir.ui.view">
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_form" />
            <field name="arch" type="xml">
                <xpath expr="//tree/field[@name='name']" position="after">
                    <field name="subcontractors"/>
                </xpath>
                <xpath expr="//tree/field[@name='price_subtotal']" position="after">
                    <field name="invalid_work_amount" invisible="1"/>
                </xpath>
                <xpath expr="//field[@name='invoice_line_ids']/tree" position="attributes">
                    <attribute name="editable"/>
                    <attribute name="colors">red:invalid_work_amount == True</attribute>
                </xpath>
            </field>
        </record>

        <record id="invoice_supplier_form" model="ir.ui.view">
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_supplier_form" />
            <field name="arch" type="xml">
                <xpath expr="//tree/field[@name='price_subtotal']" position="after">
                    <field name="invalid_work_amount" invisible="1"/>
                </xpath>
                <xpath expr="//field[@name='invoice_line_ids']/tree" position="attributes">
                    <attribute name="editable"/>
                    <attribute name="colors">red:invalid_work_amount == True</attribute>
                </xpath>
            </field>
        </record>

        <!-- VIEW FOR THE OBJECT : account_invoice -->
        <record id="view_account_invoice_tree" model="ir.ui.view">
            <field name="model">account.invoice</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="account.invoice_tree"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='currency_id']" position="before">
                    <field name="to_pay"/>
                    <field name="invalid_work_amount"/>
                </xpath>
            </field>
        </record>

        <record id="view_account_invoice_filter" model="ir.ui.view">
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.view_account_invoice_filter"/>
            <field name="arch" type="xml">
                <filter name="unpaid" position="after">
                    <filter name="to_pay" string="To pay" domain="[('to_pay','=',True)]"
                            help="Invoices to be pay"/>
                </filter>
            </field>
        </record>

</odoo>
<commit_msg>Fix color attribute in invoice view<commit_after><?xml version="1.0" encoding="utf-8"?>

<odoo>

        <!-- VIEW FOR THE OBJECT : account_invoice_line -->
        <record id="view_account_invoice_line_form" model="ir.ui.view">
            <field name="model">account.invoice.line</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="account.view_invoice_line_form" />
            <field name="arch" type="xml">
                <xpath expr="//label[@for='name']" position="before">
                    <notebook>
                        <page name="subcontractor_information"
                               string="Subcontractor Information"
                               attrs="{'invisible': [('subcontracted','=', False)]}">
                            <field name="subcontracted" invisible="1"/>
                            <field name="subcontractor_work_invoiced_id"
                                   groups="account_invoice_subcontractor.group_is_subcontractor"/>
                            <field name="invalid_work_amount" invisible="1"/>
                            <field name="subcontractor_work_ids"
                                   groups="account_invoice_subcontractor.group_have_subcontractor"
                                   nolabel="1">
                                <tree string="Subcontractor work" editable="bottom">
                                    <field name="employee_id"/>
                                    <field name="subcontractor_type" invisible="True"/>
                                    <field name="quantity" sum="Total Qty"/>
                                    <field name="uom_id"/>
                                    <field name="cost_price_unit"/>
                                    <field name="sale_price_unit"/>
                                    <field name="sale_price" sum="Total Sale Amount"/>
                                    <field name="cost_price" sum="Total Cost Amount"/>
                               </tree>
                            </field>
                        </page>
                    </notebook>
                </xpath>
            </field>
        </record>

        <record id="view_invoice_form" model="ir.ui.view">
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_form" />
            <field name="arch" type="xml">
                <xpath expr="//tree/field[@name='name']" position="after">
                    <field name="subcontractors"/>
                </xpath>
                <xpath expr="//tree/field[@name='price_subtotal']" position="after">
                    <field name="invalid_work_amount" invisible="1"/>
                </xpath>
                <xpath expr="//field[@name='invoice_line_ids']/tree" position="attributes">
                    <attribute name="editable"/>
                    <attribute name="decoration-danger">invalid_work_amount == True</attribute>
                </xpath>
            </field>
        </record>

        <record id="invoice_supplier_form" model="ir.ui.view">
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_supplier_form" />
            <field name="arch" type="xml">
                <xpath expr="//tree/field[@name='price_subtotal']" position="after">
                    <field name="invalid_work_amount" invisible="1"/>
                </xpath>
                <xpath expr="//field[@name='invoice_line_ids']/tree" position="attributes">
                    <attribute name="editable"/>
                    <attribute name="decoration-danger">invalid_work_amount == True</attribute>
                </xpath>
            </field>
        </record>

        <!-- VIEW FOR THE OBJECT : account_invoice -->
        <record id="view_account_invoice_tree" model="ir.ui.view">
            <field name="model">account.invoice</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="account.invoice_tree"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='currency_id']" position="before">
                    <field name="to_pay"/>
                    <field name="invalid_work_amount"/>
                </xpath>
            </field>
        </record>

        <record id="view_account_invoice_filter" model="ir.ui.view">
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.view_account_invoice_filter"/>
            <field name="arch" type="xml">
                <filter name="unpaid" position="after">
                    <filter name="to_pay" string="To pay" domain="[('to_pay','=',True)]"
                            help="Invoices to be pay"/>
                </filter>
            </field>
        </record>

</odoo>

{'fraction_non_alphanumeric': 0.13652299443184163, 'fraction_numerical': 0.0016498247061249743, 'mean_word_length': 1.5244664237376366, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 2, '>': 185, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2646705', 'n_tokens_mistral': 2531, 'n_tokens_neox': 2421, 'n_words': 407}