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

    <record id="crm_team_member_view_tree" model="ir.ui.view">
        <field name="name">crm.team.member.view.tree</field>
        <field name="model">crm.team.member</field>
        <field name="inherit_id" ref="sales_team.crm_team_member_view_tree"/>
        <field name="arch" type="xml">
            <field name="user_id" position="after">
                <field name="assignment_enabled" column_invisible="True"/>
                <field name="assignment_optout"/>
                <field name="assignment_max"/>
                <field name="lead_month_count"/>
            </field>
        </field>
    </record>

    <record id="crm_team_member_view_kanban" model="ir.ui.view">
        <field name="name">crm.team.member.view.kanban.inherit.crm</field>
        <field name="model">crm.team.member</field>
        <field name="inherit_id" ref="sales_team.crm_team_member_view_kanban"/>
        <field name="arch" type="xml">
            <xpath expr="//div[hasclass('oe_kanban_details')]" position="after">
                <field name="assignment_enabled" invisible="1"/>
                <field name="assignment_optout" invisible="1"/>
                <div class="o_member_assignment"
                        invisible="not assignment_enabled or assignment_optout">
                    <field name="assignment_max" invisible="1"/>
                    <field name="lead_month_count" widget="gauge"
                        options="{'max_field': 'assignment_max'}"
                        invisible="assignment_max == 0"/>
                </div>
            </xpath>
        </field>
    </record>

    <record id="crm_team_member_view_form" model="ir.ui.view">
        <field name="name">crm.team.member.view.form.inherit.crm</field>
        <field name="model">crm.team.member</field>
        <field name="inherit_id" ref="sales_team.crm_team_member_view_form"/>
        <field name="arch" type="xml">
            <xpath expr="//group[@name='member_partner_info']" position="after">
                <group name="group_assign" invisible="not assignment_enabled">
                    <field name="assignment_enabled" invisible="1"/>
                    <field name="assignment_optout"/>
                    <label for="lead_month_count" invisible="assignment_optout"/>
                    <div invisible="assignment_optout">
                        <field name="lead_month_count" class="oe_inline"/>
                        <span class="oe_inline"> / </span>
                        <field name="assignment_max" class="oe_inline"/>
                        <span class="oe_inline"> (max) </span>
                    </div>
                    <field name="assignment_domain" string="Domain" widget="domain"
                        options="{'model': 'crm.lead'}"
                        invisible="assignment_max == 0 or assignment_optout"/>
                </group>
            </xpath>
        </field>
    </record>

    <record id="sales_team.crm_team_member_action" model="ir.actions.act_window">
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Add a Team Member
            </p><p>
                Team Members are salespersons assigned to specific teams.
            </p>
        </field>
    </record>

</data></odoo>
