<commit_before><!-- pylint: disable=dangerous-view-replace-wo-priority-->
<odoo>
    <record id="view_res_partner_invoice_line_button_form" model="ir.ui.view">
        <field name="name">res.partner.sponsorships.form</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">
            <!-- Redefine how contracts are shown. -->
            <xpath expr="//div[@name='button_box']" position="inside">
                <button class="oe_inline oe_stat_button" type="object" name="open_contracts" icon="fa-book">
                    <field string="Sponsorships" name="number_sponsorships" widget="statinfo"/>
                </button>
                <button class="oe_inline oe_stat_button" type="object" name="open_sponsored_children" icon="fa-child">
                    <field string="Sponsored children" name="number_children" widget="statinfo"/>
                </button>
            </xpath>
            <xpath expr="//page[1]" position="before">
                <page string="Sponsorships" groups="child_compassion.group_sponsorship" autofocus="autofocus">
                    <button name="create_contract" string="Add" type="object"/>
                    <field name="contracts_fully_managed" invisible="True" />
                    <field name="contracts_paid" invisible="True" />
                    <field name="contracts_correspondant" invisible="True" />
                    <div attrs="{'invisible' : [('contracts_paid','=', [])]}">
                        <h3>Sponsorships as payer only</h3>
                        <field name="contracts_paid" context="{'default_type': 'S'}">
                            <tree colors="blue:state == 'draft';black:state == 'active';gray:state == 'terminated'">
                                <field name="child_id" />
                                <field name="child_name" />
                                <field name="start_date" />
                                <field name="end_date" />
                                <field name="payment_mode_id" />
                                <field name="group_freq"/>
                                <field name="last_paid_invoice_date"/>
                                <field name="months_paid"/>
                                <field name="total_amount" />
                                <field name="state" />
                                <button name="open_contract" type="object" string="open" />
                            </tree>
                        </field>
                    </div>
                    <div attrs="{'invisible' : [('contracts_correspondant','=', [])]}">
                        <h3>Sponsorships as correspondent only</h3>
                        <field name="contracts_correspondant" context="{'default_type': 'S'}">
                            <tree colors="blue:state == 'draft';black:state == 'active';gray:state == 'terminated'">
                                <field name="child_id" />
                                <field name="child_name" />
                                <field name="start_date" />
                                <field name="end_date" />
                                <field name="payment_mode_id" />
                                <field name="group_freq"/>
                                <field name="last_paid_invoice_date"/>
                                <field name="months_paid"/>
                                <field name="total_amount" />
                                <field name="state" />
                                <button name="open_contract" type="object" icon="fa-external-link"  />
                            </tree>
                        </field>
                    </div>
                    <div attrs="{'invisible' : [('contracts_fully_managed','=', [])]}">
                        <h3>Sponsorships fully managed</h3>
                        <field name="contracts_fully_managed" context="{'default_type': 'S'}">
                            <tree colors="blue:state == 'draft';black:state == 'active';gray:state == 'terminated'">
                                <field name="child_id" />
                                <field name="child_name" />
                                <field name="start_date" />
                                <field name="end_date" />
                                <field name="payment_mode_id" />
                                <field name="group_freq"/>
                                <field name="last_paid_invoice_date"/>
                                <field name="months_paid"/>
                                <field name="total_amount" />
                                <field name="state" />
                                <button name="open_contract" type="object" icon="fa-external-link"  />
                            </tree>
                        </field>
                    </div>
                    <div attrs="{'invisible' : [('other_contract_ids','=', [])]}">
                        <h3>Other contracts</h3>
                        <field name="other_contract_ids" context="{'default_type': 'O'}">
                            <tree colors="blue:state == 'draft';black:state == 'active';gray:state == 'terminated'">
                                <field name="name" />
                                <field name="start_date" />
                                <field name="end_date" />
                                <field name="payment_mode_id" />
                                <field name="group_freq"/>
                                <field name="last_paid_invoice_date"/>
                                <field name="months_paid"/>
                                <field name="total_amount" />
                                <field name="state" />
                                <button name="open_contract" type="object" icon="fa-external-link"  />
                            </tree>
                        </field>
                    </div>
                </page>
            </xpath>
            <field name="website" position="after">
                <field name="send_original"/>
            </field>

        </field>
    </record>
    <record id="compassion_partner_view_buttons" model="ir.ui.view">
        <!--pylint:disable=dangerous-view-replace-wo-priority-->
        <field name="name">compassion.partner.view.buttons</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="sale.res_partner_view_buttons" />
        <field name="arch" type="xml">
            <!-- to change icone of smart button, you can find tag here:http://fortawesome.github.io/Font-Awesome/icons/ --><commit_msg>CO-1758 FIX tree colors for partner sponsorships view<commit_after><!-- pylint: disable=dangerous-view-replace-wo-priority-->
<odoo>
    <record id="view_res_partner_invoice_line_button_form" model="ir.ui.view">
        <field name="name">res.partner.sponsorships.form</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">
            <!-- Redefine how contracts are shown. -->
            <xpath expr="//div[@name='button_box']" position="inside">
                <button class="oe_inline oe_stat_button" type="object" name="open_contracts" icon="fa-book">
                    <field string="Sponsorships" name="number_sponsorships" widget="statinfo"/>
                </button>
                <button class="oe_inline oe_stat_button" type="object" name="open_sponsored_children" icon="fa-child">
                    <field string="Sponsored children" name="number_children" widget="statinfo"/>
                </button>
            </xpath>
            <xpath expr="//page[1]" position="before">
                <page string="Sponsorships" groups="child_compassion.group_sponsorship" autofocus="autofocus">
                    <button name="create_contract" string="Add" type="object"/>
                    <field name="contracts_fully_managed" invisible="True" />
                    <field name="contracts_paid" invisible="True" />
                    <field name="contracts_correspondant" invisible="True" />
                    <div attrs="{'invisible' : [('contracts_paid','=', [])]}">
                        <h3>Sponsorships as payer only</h3>
                        <field name="contracts_paid" context="{'default_type': 'S'}">
                            <tree colors="blue:state == 'draft';black:state == 'active';green: state == 'waiting';gray:state in ('terminated','cancelled')">
                                <field name="child_id" />
                                <field name="child_name" />
                                <field name="start_date" />
                                <field name="end_date" />
                                <field name="payment_mode_id" />
                                <field name="group_freq"/>
                                <field name="last_paid_invoice_date"/>
                                <field name="months_paid"/>
                                <field name="total_amount" />
                                <field name="state" />
                                <button name="open_contract" type="object" icon="fa-external-link" />
                            </tree>
                        </field>
                    </div>
                    <div attrs="{'invisible' : [('contracts_correspondant','=', [])]}">
                        <h3>Sponsorships as correspondent only</h3>
                        <field name="contracts_correspondant" context="{'default_type': 'S'}">
                            <tree colors="blue:state == 'draft';black:state == 'active';green: state == 'waiting';gray:state in ('terminated','cancelled')">
                                <field name="child_id" />
                                <field name="child_name" />
                                <field name="start_date" />
                                <field name="end_date" />
                                <field name="payment_mode_id" />
                                <field name="group_freq"/>
                                <field name="last_paid_invoice_date"/>
                                <field name="months_paid"/>
                                <field name="total_amount" />
                                <field name="state" />
                                <button name="open_contract" type="object" icon="fa-external-link"  />
                            </tree>
                        </field>
                    </div>
                    <div attrs="{'invisible' : [('contracts_fully_managed','=', [])]}">
                        <h3>Sponsorships fully managed</h3>
                        <field name="contracts_fully_managed" context="{'default_type': 'S'}">
                            <tree colors="blue:state == 'draft';black:state == 'active';green: state == 'waiting';gray:state in ('terminated','cancelled')">
                                <field name="child_id" />
                                <field name="child_name" />
                                <field name="start_date" />
                                <field name="end_date" />
                                <field name="payment_mode_id" />
                                <field name="group_freq"/>
                                <field name="last_paid_invoice_date"/>
                                <field name="months_paid"/>
                                <field name="total_amount" />
                                <field name="state" />
                                <button name="open_contract" type="object" icon="fa-external-link"  />
                            </tree>
                        </field>
                    </div>
                    <div attrs="{'invisible' : [('other_contract_ids','=', [])]}">
                        <h3>Other contracts</h3>
                        <field name="other_contract_ids" context="{'default_type': 'O'}">
                            <tree colors="blue:state == 'draft';black:state == 'active';green: state == 'waiting';gray:state in ('terminated','cancelled')">
                                <field name="name" />
                                <field name="start_date" />
                                <field name="end_date" />
                                <field name="payment_mode_id" />
                                <field name="group_freq"/>
                                <field name="last_paid_invoice_date"/>
                                <field name="months_paid"/>
                                <field name="total_amount" />
                                <field name="state" />
                                <button name="open_contract" type="object" icon="fa-external-link"  />
                            </tree>
                        </field>
                    </div>
                </page>
            </xpath>
            <field name="website" position="after">
                <field name="send_original"/>
            </field>

        </field>
    </record>
    <record id="compassion_partner_view_buttons" model="ir.ui.view">
        <!--pylint:disable=dangerous-view-replace-wo-priority-->
        <field name="name">compassion.partner.view.buttons</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="sale.res_partner_view_buttons" />
        <field name="arch" type="xml">
            <!-- to change icone of smart button, you can find tag here:http://fortawesome.github.io/Font-Awesome/icons/ -->
{'fraction_non_alphanumeric': 0.13585762413944633, 'fraction_numerical': 0.0016112494507104144, 'mean_word_length': 1.3124470787468248, 'pattern_counts': {'":': 0, '<': 233, '<?xml version=': 0, '>': 233, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4733510', 'n_tokens_mistral': 3487, 'n_tokens_neox': 3299, 'n_words': 561}