<commit_before><openerp>
    <data>
        <!-- Replace opt_out view -->
        <record id="email_template.res_partner_opt_out_form" model="ir.ui.view">
            <field name="arch" type="xml">
                <page name="sales_purchases"/>
            </field>
        </record>

        <!-- Move title before lastname -->
        <record id="view_partner_form_compassion_firstname" model="ir.ui.view">
            <field name="name">res.partner.form.compassion.firstname</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="partner_firstname.view_partner_form_firstname"/>
            <field name="arch" type="xml">
                <!-- Move title field and add it in inner contact form -->
                <field name="title" position="replace"/>
                <field name="lastname" position="before">
                    <field name="title" attrs="{'required': [('is_company', '=', False)]}"/>
                </field>
                <field name="firstname" position="after">
                    <field name="preferred_name"/>
                </field>
                <xpath expr="//form[@string='Contact']/sheet//field[@name='lastname']" position="before">
                    <field name="title" />
                </xpath>
            </field>
        </record>

        <!-- Remove old send_original field -->
        <record id="view_remove_send_original" model="ir.ui.view">
            <field name="name">res.partner.form.remove.send_original</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="sponsorship_compassion.view_res_partner_invoice_line_button_form"/>
            <field name="arch" type="xml">
                <field name="send_original" position="replace"/>
            </field>
        </record>

        <!-- Remove birthdate duplicate -->
        <record id="view_partner_form_compassion_birthdate" model="ir.ui.view">
            <field name="name">res.partner.form.compassion.birthdate</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
            <field name="arch" type="xml">
                <page name="personal_information_page" position="replace"/>
            </field>
        </record>

        <!-- Redefine form view -->
        <record id="view_partner_form_compassion_ch" model="ir.ui.view">
            <field name="name">res.partner.form.compassion.switzerland</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="sbc_compassion.view_partner_form_sbc"/>
            <field name="priority">3</field>
            <field name="arch" type="xml">
                <!-- Redefine Sales Tab -->
                <page name="sales_purchases" position="replace">
                    <page name="sales_purchases" string="Sales &amp; Purchases">
                        <group>
                            <group>
                                <field name="user_id"/>
                            </group>
                            <group>
                                <field name="customer"/>
                                <field name="supplier"/>
                            </group>
                            <group>
                                <field name="date"/>
                            </group>
                            <group>
                                <field name="active"/>
                                <field name="notify_email"/>
                            </group>
                            
                        </group>
                    </page>
                </page>

                <!-- Make child_ids readonly to avoid creating partners from a company -->
                <field name="child_ids" position="attributes">
                    <attribute name="readonly">1</attribute>
                </field>

                <!-- Add street3 in the form of the partner -->
                <field name="street2" position="after">
                    <field name="street3" attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                </field>

                <!-- Add the church field -->
                <field name="email" position="after">
                    <field name="is_church" invisible="1"/>
                    <field name="church_id" attrs="{'invisible': ['|',('is_company','=',True),('is_church','=',True)]}"
                           context="{'tree_view_ref' : 'partner_compassion.view_partner_tree_compassion',
                                     'default_is_company': True, 'default_category_id': [(4, 20)]}"/>
                    <field name="church_unlinked" attrs="{'invisible': ['|',('is_company','=',True),'|',('is_church','=',True),('church_id','>',0)]}"/>
                </field>

                <!-- Add birthdate and deathdate -->
                <xpath expr="//field[@name='website'][1]" position="after">
                    <field name="birthdate_date" attrs="{'invisible': [('is_company','=',True)]}"/>
                    <field name="deathdate" attrs="{'invisible': [('is_company','=',True)]}"/>
                </xpath>

                <!-- Add the church members list in a church partner -->
                <xpath expr="//page[@string='Contacts']" position="after">
                    <page string="Members" attrs="{'invisible': [('is_church','=',False), ('member_ids', '=', [])]}" autofocus="autofocus">
                        <field name="member_ids" mode="kanban" context="{'default_church_id': active_id, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id}"/>
                    </page>
                </xpath>

                <!-- Add correspondance tab -->
                <xpath expr="//page[@string='Sponsorships']" position="after">
                    <page string="Correspondence">
                        <button name="open_letters" type="object" string="Letters"/>
                        <group>
                            <group>
                                <field name="global_communication_delivery_preference"/>
                                <field name="photo_delivery_preference"/>
                                <field name="letter_delivery_preference"/>
                                <field name="send_original"/>
                                <field name="mandatory_review"/>
                            </group>
                            <group>
                                <field name="abroad"/>
                                <field name="opt_out"/>
                            </group>
                            <group>
                                <field name="nbmag"/>
                                <field name="calendar"/>
                                <field name="christmas_card"/>
                                <field name="birthday_reminder"/>
                            </group>
                            <group>
                                <field name="tax_certificate"/>
                                <field name="thankyou_letter"/>                                      
                            </group>
                        </group>
                    </page>
                </xpath>

                <!-- Move reference field -->
                <field name="parent_id" position="after">
                    <label for="ref"/>
                    <field name="ref" readonly="1" required="0"/>
                    <label for="global_id"/>
                    <field name="global_id" readonly="1"/>
                </field>
                
                <!-- Move lang field -->
                <label string="Address" position="before">
                    <field name="lang"/>
                    <field name="spoken_lang_ids" widget="many2many_tags" options="{'create':False}" attrs="{'required': [('is_company', '=', False), ('customer', '=', True)]}"/>
                </label>
                
                <!-- Remove fax -->
                <field name="fax" position="replace"/>

            </field>
        </record>
        
        <!-- Extends the tree view of the partners to display city and other fields -->
        <record id="view_partner_tree_compassion" model="ir.ui.view">
            <field name="name">res.partner.tree.compassion</field>
            <field name="model">res.partner</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="base.view_partner_tree"/>            
            <field name="arch" type="xml">
                <field name="display_name" position="after">
                    <field name="lang"/>
                    <field name="zip"/>
                    <field name="city"/>
                </field>
            </field>
        </record>
        
        <!-- Extends the search on partners -->
        <record model="ir.ui.view" id="res_partner_compassion_search">
            <field name="name">res.partner.compassion.search</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_res_partner_filter"/>
            <field name="arch" type="xml">
                <field name="category_id" position="after">
                    <field name="lang" />
                    <field name="city" filter_domain="['|',('city','ilike', self),('zip','ilike',self)]" />
                </field>
                <xpath expr="//group">
                    <filter string="Language" context="{'group_by': 'lang'}"/>
                </xpath>
            </field>
        </record>
        
        <!-- Redefine action of partners for sponsorship section -->
        <record id="action_partner_supporter_form" model="ir.actions.act_window">
            <field name="name">Supporters</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">res.partner</field>
            <field name="view_type">form</field>
            <field name="view_mode">list,kanban,form,geoengine</field>
            <field name="domain">[]</field>
            <field name="context">{'default_customer':1, 'search_default_customer':1, 'default_nbmag':1, 'default_opt_out':0}</field>
            <field name="filter" eval="True"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to add a contact in your address book.
              </p><p>
                Odoo helps you easily track all activities related to
                a customer: discussions, history of business opportunities,
                documents, etc.
              </p>
            </field>
        </record>
        <menuitem id="sponsorship_compassion.open_customers" action="action_partner_supporter_form" parent="child_compassion.menu_sponsorship_section" sequence="0"/>
    </data>
</openerp>
<commit_msg>CO-625 Add default sponsor filter<commit_after><openerp>
    <data>
        <!-- Replace opt_out view -->
        <record id="email_template.res_partner_opt_out_form" model="ir.ui.view">
            <field name="arch" type="xml">
                <page name="sales_purchases"/>
            </field>
        </record>

        <!-- Move title before lastname -->
        <record id="view_partner_form_compassion_firstname" model="ir.ui.view">
            <field name="name">res.partner.form.compassion.firstname</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="partner_firstname.view_partner_form_firstname"/>
            <field name="arch" type="xml">
                <!-- Move title field and add it in inner contact form -->
                <field name="title" position="replace"/>
                <field name="lastname" position="before">
                    <field name="title" attrs="{'required': [('is_company', '=', False)]}"/>
                </field>
                <field name="firstname" position="after">
                    <field name="preferred_name"/>
                </field>
                <xpath expr="//form[@string='Contact']/sheet//field[@name='lastname']" position="before">
                    <field name="title" />
                </xpath>
            </field>
        </record>

        <!-- Remove old send_original field -->
        <record id="view_remove_send_original" model="ir.ui.view">
            <field name="name">res.partner.form.remove.send_original</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="sponsorship_compassion.view_res_partner_invoice_line_button_form"/>
            <field name="arch" type="xml">
                <field name="send_original" position="replace"/>
            </field>
        </record>

        <!-- Remove birthdate duplicate -->
        <record id="view_partner_form_compassion_birthdate" model="ir.ui.view">
            <field name="name">res.partner.form.compassion.birthdate</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
            <field name="arch" type="xml">
                <page name="personal_information_page" position="replace"/>
            </field>
        </record>

        <!-- Redefine form view -->
        <record id="view_partner_form_compassion_ch" model="ir.ui.view">
            <field name="name">res.partner.form.compassion.switzerland</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="sbc_compassion.view_partner_form_sbc"/>
            <field name="priority">3</field>
            <field name="arch" type="xml">
                <!-- Redefine Sales Tab -->
                <page name="sales_purchases" position="replace">
                    <page name="sales_purchases" string="Sales &amp; Purchases">
                        <group>
                            <group>
                                <field name="user_id"/>
                            </group>
                            <group>
                                <field name="customer"/>
                                <field name="supplier"/>
                            </group>
                            <group>
                                <field name="date"/>
                            </group>
                            <group>
                                <field name="active"/>
                                <field name="notify_email"/>
                            </group>
                            
                        </group>
                    </page>
                </page>

                <!-- Make child_ids readonly to avoid creating partners from a company -->
                <field name="child_ids" position="attributes">
                    <attribute name="readonly">1</attribute>
                </field>

                <!-- Add street3 in the form of the partner -->
                <field name="street2" position="after">
                    <field name="street3" attrs="{'readonly': [('use_parent_address','=',True)]}"/>
                </field>

                <!-- Add the church field -->
                <field name="email" position="after">
                    <field name="is_church" invisible="1"/>
                    <field name="church_id" attrs="{'invisible': ['|',('is_company','=',True),('is_church','=',True)]}"
                           context="{'tree_view_ref' : 'partner_compassion.view_partner_tree_compassion',
                                     'default_is_company': True, 'default_category_id': [(4, 20)]}"/>
                    <field name="church_unlinked" attrs="{'invisible': ['|',('is_company','=',True),'|',('is_church','=',True),('church_id','>',0)]}"/>
                </field>

                <!-- Add birthdate and deathdate -->
                <xpath expr="//field[@name='website'][1]" position="after">
                    <field name="birthdate_date" attrs="{'invisible': [('is_company','=',True)]}"/>
                    <field name="deathdate" attrs="{'invisible': [('is_company','=',True)]}"/>
                </xpath>

                <!-- Add the church members list in a church partner -->
                <xpath expr="//page[@string='Contacts']" position="after">
                    <page string="Members" attrs="{'invisible': [('is_church','=',False), ('member_ids', '=', [])]}" autofocus="autofocus">
                        <field name="member_ids" mode="kanban" context="{'default_church_id': active_id, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id}"/>
                    </page>
                </xpath>

                <!-- Add correspondance tab -->
                <xpath expr="//page[@string='Sponsorships']" position="after">
                    <page string="Correspondence">
                        <button name="open_letters" type="object" string="Letters"/>
                        <group>
                            <group>
                                <field name="global_communication_delivery_preference"/>
                                <field name="photo_delivery_preference"/>
                                <field name="letter_delivery_preference"/>
                                <field name="send_original"/>
                                <field name="mandatory_review"/>
                            </group>
                            <group>
                                <field name="abroad"/>
                                <field name="opt_out"/>
                            </group>
                            <group>
                                <field name="nbmag"/>
                                <field name="calendar"/>
                                <field name="christmas_card"/>
                                <field name="birthday_reminder"/>
                            </group>
                            <group>
                                <field name="tax_certificate"/>
                                <field name="thankyou_letter"/>                                      
                            </group>
                        </group>
                    </page>
                </xpath>

                <!-- Move reference field -->
                <field name="parent_id" position="after">
                    <label for="ref"/>
                    <field name="ref" readonly="1" required="0"/>
                    <label for="global_id"/>
                    <field name="global_id" readonly="1"/>
                </field>
                
                <!-- Move lang field -->
                <label string="Address" position="before">
                    <field name="lang"/>
                    <field name="spoken_lang_ids" widget="many2many_tags" options="{'create':False}" attrs="{'required': [('is_company', '=', False), ('customer', '=', True)]}"/>
                </label>
                
                <!-- Remove fax -->
                <field name="fax" position="replace"/>

            </field>
        </record>
        
        <!-- Extends the tree view of the partners to display city and other fields -->
        <record id="view_partner_tree_compassion" model="ir.ui.view">
            <field name="name">res.partner.tree.compassion</field>
            <field name="model">res.partner</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="base.view_partner_tree"/>            
            <field name="arch" type="xml">
                <field name="display_name" position="after">
                    <field name="lang"/>
                    <field name="zip"/>
                    <field name="city"/>
                </field>
            </field>
        </record>
        
        <!-- Extends the search on partners -->
        <record model="ir.ui.view" id="res_partner_compassion_search">
            <field name="name">res.partner.compassion.search</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_res_partner_filter"/>
            <field name="arch" type="xml">
                <field name="category_id" position="after">
                    <field name="lang" />
                    <field name="city" filter_domain="['|',('city','ilike', self),('zip','ilike',self)]" />
                </field>
                <xpath expr="//group">
                    <filter string="Language" context="{'group_by': 'lang'}"/>
                </xpath>
                <filter name="supplier" position="after">
                        <separator />
                        <filter string="Sponsor" name="sponsor" domain="[('category_id.name', 'like', 'Sponsor')]"/>
                </filter>
            </field>
        </record>
        
        <!-- Redefine action of partners for sponsorship section -->
        <record id="action_partner_supporter_form" model="ir.actions.act_window">
            <field name="name">Supporters</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">res.partner</field>
            <field name="view_type">form</field>
            <field name="view_mode">list,kanban,form,geoengine</field>
            <field name="domain">[]</field>
            <field name="context">{'default_customer':1, 'search_default_customer':1, 'default_nbmag':1, 'default_opt_out':0, 'search_default_sponsor': 1}</field>
            <field name="filter" eval="True"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to add a contact in your address book.
              </p><p>
                Odoo helps you easily track all activities related to
                a customer: discussions, history of business opportunities,
                documents, etc.
              </p>
            </field>
        </record>
        <menuitem id="sponsorship_compassion.open_customers" action="action_partner_supporter_form" parent="child_compassion.menu_sponsorship_section" sequence="0"/>
    </data>
</openerp>

{'fraction_non_alphanumeric': 0.144979738856371, 'fraction_numerical': 0.001981089599279604, 'mean_word_length': 1.5012387387387387, 'pattern_counts': {'":': 0, '<': 435, '<?xml version=': 0, '>': 437, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6266066', 'n_tokens_mistral': 5772, 'n_tokens_neox': 5474, 'n_words': 1045}