<?xml version="1.0" encoding="utf-8"?>
<terp>
    <data>
        
        <!--
	Cases by user and section
	-->
        
        <record id="view_crm_case_user_tree" model="ir.ui.view">
            <field name="name">report.crm.case.user.tree</field>
            <field name="model">report.crm.case.user</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Cases by User and Section">
                    <field name="name"/>
                    <field name="user_id"/>
                    <field name="section_id"/>
                    <field name="nbr"/>
                    <field name="delay_close"/>
                    <field name="amount_revenue"/>
                    <field name="amount_costs"/>
                    <field name="amount_revenue_prob"/>
                    <field name="probability"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        <record id="view_crm_case_user_form" model="ir.ui.view">
            <field name="name">report.crm.case.user.form</field>
            <field name="model">report.crm.case.user</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Cases by User and Section">
                    <field name="name" select="1"/>
                    <field name="user_id" select="1"/>
                    <field name="section_id" select="1"/>
                    <field name="nbr" select="1"/>
                    <field name="state" select="1"/>
                </form>
            </field>
        </record>
        
        <record id="view_crm_case_user_graph" model="ir.ui.view">
            <field name="name">report.crm.case.user.graph</field>
            <field name="model">report.crm.case.user</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph orientation="horizontal" string="Cases by User and Section" type="bar">
                    <field name="state"/>
                    <field name="nbr" operator="+"/>
                    <field group="True" name="user_id"/>
                </graph>
            </field>
        </record>
        
        
        <record id="action_report_crm_case_user_tree_month" model="ir.actions.act_window">
            <field name="name">Cases by user and section (this month)</field>
            <field name="res_model">report.crm.case.user</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,graph</field>
            <field name="domain">[('name','=',time.strftime('%Y-%m-01'))]</field>
        </record>
        
        <menuitem id="next_id_64" name="Reporting" parent="crm.menu_crm"/><menuitem id="next_id_65" name="This Month" parent="next_id_64"/><menuitem action="action_report_crm_case_user_tree_month" id="menu_crm_case_user_tree_month" parent="next_id_65"/>
        
        <record id="action_report_crm_case_user_tree" model="ir.actions.act_window">
            <field name="name">Cases by User and Section</field>
            <field name="res_model">report.crm.case.user</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
        </record>
        <menuitem id="next_id_66" name="All Months" parent="report_crm.next_id_64"/><menuitem action="action_report_crm_case_user_tree" id="menu_crm_case_user_tree" parent="next_id_66"/>
        
        <record id="action_report_crm_case_user_tree_month_my" model="ir.actions.act_window">
            <field name="name">My cases by section (this month)</field>
            <field name="res_model">report.crm.case.user</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="domain">[('user_id','=',uid),('name','=',time.strftime('%Y-%m-01'))]</field>
        </record>
        <menuitem action="action_report_crm_case_user_tree_month_my" id="menu_crm_case_user_tree_month_my" parent="report_crm.next_id_65"/>
        
        <record id="action_report_crm_case_user_tree_my" model="ir.actions.act_window">
            <field name="name">My cases by section</field>
            <field name="res_model">report.crm.case.user</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="domain">[('user_id','=',uid)]</field>
        </record>
        <menuitem action="action_report_crm_case_user_tree_my" id="menu_crm_case_user_tree_my" parent="report_crm.next_id_66"/>
        
        <!-- # Cases by section and categoryof case -->
        
        <record id="view_crm_case_categ_tree" model="ir.ui.view">
            <field name="name">report.crm.case.categ.tree</field>
            <field name="model">report.crm.case.categ</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Cases by User and Section">
                    <field name="name"/>
                    <field name="categ_id"/>
                    <field name="section_id"/>
                    <field name="nbr"/>
                    <field name="delay_close"/>
                    <field name="amount_revenue"/>
                    <field name="amount_costs"/>
                    <field name="amount_revenue_prob"/>
                    <field name="probability"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        <record id="view_crm_case_categ_form" model="ir.ui.view">
            <field name="name">report.crm.case.categ.form</field>
            <field name="model">report.crm.case.categ</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Cases by User and Section">
                    <field name="name" select="1"/>
                    <field name="categ_id" select="1"/>
                    <field name="section_id" select="1"/>
                    <field name="nbr" select="1"/>
                    <field name="state" select="1"/>
                </form>
            </field>
        </record>
        
        
        <record id="action_report_crm_case_categ_tree_month" model="ir.actions.act_window">
            <field name="name">Cases by categories and section (this month)</field>
            <field name="res_model">report.crm.case.categ</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="domain">[('name','=',time.strftime('%Y-%m-01'))]</field>
        </record>
        <menuitem action="action_report_crm_case_categ_tree_month" id="menu_crm_case_categ_tree_month" parent="report_crm.next_id_65"/>
        <record id="action_report_crm_case_categ_tree" model="ir.actions.act_window">
            <field name="name">Cases by Categories and Section</field>
            <field name="res_model">report.crm.case.categ</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
        </record>
        <menuitem action="action_report_crm_case_categ_tree" id="menu_crm_case_categ_tree" parent="report_crm.next_id_66"/>
        
        <act_window domain="[('user_id', '=', active_id)]" id="act_res_users_2_report_crm_case_user" name="Monthly cases" res_model="report.crm.case.user" src_model="res.users"/>
        
        <act_window domain="[('section_id', '=', active_id)]" id="act_crm_case_section_2_report_crm_case_user" name="Monthly cases by user" res_model="report.crm.case.user" src_model="crm.case.section"/>
        
        <act_window domain="[('crm.case.categ', '=', active_id)]" id="act_crm_case_categ_2_report_crm_case_categ" name="Monthly cases" res_model="report.crm.case.categ" src_model="crm.case.categ"/>
        
        <act_window domain="[('section_id', '=', active_id)]" id="act_crm_case_section_2_report_crm_case_categ" name="Monthly cases by section" res_model="report.crm.case.categ" src_model="crm.case.section"/>
        
    </data>
</terp>