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

        <!--     Opportunity tree view  -->
        <record id="view_report_crm_partner_assign_filter" model="ir.ui.view">
            <field name="name">crm.partner.report.assign.select</field>
            <field name="model">crm.partner.report.assign</field>
            <field name="arch" type="xml">
                <search string="Partner assigned Analysis">
                    <field name="section_id" groups="base.group_multi_salesteams"/>
                    <field name="user_id"/>
                    <field name="grade_id"/>
                    <field name="activation"/>
                    <group  expand="1" string="Group By">
                        <filter string="Salesperson" name="user"
                            context="{'group_by':'user_id'}" />
                        <filter string="Sales Team"
                            context="{'group_by':'section_id'}" groups="base.group_multi_salesteams"/>
                        <filter string="Partner" name=""
                            context="{'group_by':'partner_id'}" />
                        <separator/>
                        <filter string="Date Partnership" name="group_date_partnership"
                            context="{'group_by':'date_partnership'}" />
                        <filter string="Date Review" name="group_date_review"
                            context="{'group_by':'date_review'}" />
                    </group>
                </search>
            </field>
        </record>

       <record id="view_report_crm_partner_assign_graph" model="ir.ui.view">
            <field name="name">crm.partner.assign.report.graph</field>
            <field name="model">crm.partner.report.assign</field>
            <field name="arch" type="xml">
                <graph string="Opportunities Assignment Analysis" type="pivot" stacked="True">
                    <field name="grade_id" type="row"/>
                    <field name="opp" type="measure"/>
                    <field name="turnover" type="measure"/>
                </graph>
            </field>
       </record>

       <!-- Leads by user and section Action -->

       <record id="action_report_crm_partner_assign" model="ir.actions.act_window">
            <field name="name">Partnership Analysis</field>
            <field name="res_model">crm.partner.report.assign</field>
            <field name="context">{'group_by_no_leaf':1,'group_by':[]}</field>
            <field name="view_mode">graph</field>
            <field name="domain">[('grade_id', '!=', False)]</field>
        </record>

       <menuitem id="menu_report_crm_partner_assign_tree"
           parent="base.next_id_64" action="action_report_crm_partner_assign" sequence="25"/>

    </data>
</openerp>
