<?xml version="1.0"?>
<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
    <data>
        <menuitem
            name="Opportunities"
            parent="sale.menu_reporting"
            sequence="50"
            id="menu_reporting_opportunity"
            icon="tryton-graph"/>

        <record model="ir.ui.view" id="reporting_context_view_form">
            <field name="model">sale.opportunity.reporting.context</field>
            <field name="type">form</field>
            <field name="name">opportunity_reporting_context_form</field>
        </record>

        <!-- Main -->

        <record model="ir.ui.view" id="reporting_main_view_list">
            <field name="model">sale.opportunity.reporting.main</field>
            <field name="type">tree</field>
            <field name="name">opportunity_reporting_main_list</field>
        </record>

        <record model="ir.ui.view" id="reporting_main_view_graph_number">
            <field name="model">sale.opportunity.reporting.main</field>
            <field name="type">graph</field>
            <field name="name">opportunity_reporting_main_graph_number</field>
        </record>

        <record model="ir.ui.view" id="reporting_main_view_graph_amount">
            <field name="model">sale.opportunity.reporting.main</field>
            <field name="type">graph</field>
            <field name="name">opportunity_reporting_main_graph_amount</field>
        </record>

        <record model="ir.action.act_window" id="act_reporting_main">
            <field name="name">Opportunities</field>
            <field name="res_model">sale.opportunity.reporting.main</field>
            <field name="context_model">sale.opportunity.reporting.context</field>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_main_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="reporting_main_view_list"/>
            <field name="act_window" ref="act_reporting_main"/>
        </record>
        <record model="ir.action.keyword" id="act_reporting_main_keyword1">
            <field name="keyword">tree_open</field>
            <field name="model" ref="menu_reporting_opportunity"/>
            <field name="action" ref="act_reporting_main"/>
        </record>

        <record model="ir.rule.group" id="rule_group_reporting_main_companies">
            <field name="name">User in companies</field>
            <field name="model">sale.opportunity.reporting.main</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_reporting_main_companies">
            <field
                name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_reporting_main_companies"/>
        </record>

        <record model="ir.model.access" id="access_reporting_main">
            <field name="model">sale.opportunity.reporting.main</field>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_reporting_main_sale">
            <field name="model">sale.opportunity.reporting.main</field>
            <field name="group" ref="sale.group_sale"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>

        <record model="ir.ui.view" id="reporting_main_time_series_view_list">
            <field name="model">sale.opportunity.reporting.main.time_series</field>
            <field name="type">tree</field>
            <field name="name">opportunity_reporting_main_time_series_list</field>
        </record>

        <record model="ir.ui.view" id="reporting_main_time_series_view_graph_number">
            <field name="model">sale.opportunity.reporting.main.time_series</field>
            <field name="type" eval="None"/>
            <field name="inherit" ref="reporting_main_view_graph_number"/>
            <field name="name">opportunity_reporting_main_time_series_graph_number</field>
        </record>

        <record model="ir.ui.view" id="reporting_main_time_series_view_graph_amount">
            <field name="model">sale.opportunity.reporting.main.time_series</field>
            <field name="type" eval="None"/>
            <field name="inherit" ref="reporting_main_view_graph_amount"/>
            <field name="name">opportunity_reporting_main_time_series_graph_amount</field>
        </record>

        <record model="ir.action.act_window" id="act_reporting_main_time_series">
            <field name="name">Opportunities</field>
            <field name="res_model">sale.opportunity.reporting.main.time_series</field>
            <field name="context_model">sale.opportunity.reporting.context</field>
            <field name="order" eval="[('date', 'DESC')]" pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_main_time_series_list_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="reporting_main_time_series_view_list"/>
            <field name="act_window" ref="act_reporting_main_time_series"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_main_time_series_list_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="reporting_main_time_series_view_graph_number"/>
            <field name="act_window" ref="act_reporting_main_time_series"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_main_time_series_list_view3">
            <field name="sequence" eval="30"/>
            <field name="view" ref="reporting_main_time_series_view_graph_amount"/>
            <field name="act_window" ref="act_reporting_main_time_series"/>
        </record>
        <record model="ir.action.keyword" id="act_reporting_main_time_series_list_keyword1">
            <field name="keyword">tree_open</field>
            <field name="model">sale.opportunity.reporting.main,-1</field>
            <field name="action" ref="act_reporting_main_time_series"/>
        </record>

        <record model="ir.rule.group" id="rule_group_reporting_main_time_series_companies">
            <field name="name">User in companies</field>
            <field name="model">sale.opportunity.reporting.main.time_series</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_reporting_main_time_series_companies">
            <field
                name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_reporting_main_time_series_companies"/>
        </record>

        <record model="ir.model.access" id="access_reporting_main_time_series">
            <field name="model">sale.opportunity.reporting.main.time_series</field>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_reporting_main_time_series_sale">
            <field name="model">sale.opportunity.reporting.main.time_series</field>
            <field name="group" ref="sale.group_sale"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>

        <!-- Conversion -->

        <record model="ir.ui.view" id="reporting_conversion_view_list">
            <field name="model">sale.opportunity.reporting.conversion</field>
            <field name="type">tree</field>
            <field name="name">opportunity_reporting_conversion_list</field>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_view_graph_number">
            <field name="model">sale.opportunity.reporting.conversion</field>
            <field name="type">graph</field>
            <field name="name">opportunity_reporting_conversion_graph_number</field>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_view_graph_amount">
            <field name="model">sale.opportunity.reporting.conversion</field>
            <field name="type">graph</field>
            <field name="name">opportunity_reporting_conversion_graph_amount</field>
        </record>

        <record model="ir.action.act_window" id="act_reporting_conversion">
            <field name="name">Opportunity Conversions</field>
            <field name="res_model">sale.opportunity.reporting.conversion</field>
            <field name="context_model">sale.opportunity.reporting.context</field>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="reporting_conversion_view_list"/>
            <field name="act_window" ref="act_reporting_conversion"/>
        </record>
        <record model="ir.action.keyword" id="act_reporting_conversion_keyword1">
            <field name="keyword">tree_open</field>
            <field name="model" ref="menu_reporting_opportunity"/>
            <field name="action" ref="act_reporting_conversion"/>
        </record>

        <record model="ir.rule.group" id="rule_group_reporting_conversion_companies">
            <field name="name">User in companies</field>
            <field name="model">sale.opportunity.reporting.conversion</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_reporting_conversion_companies">
            <field
                name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_reporting_conversion_companies"/>
        </record>

        <record model="ir.model.access" id="access_reporting_conversion">
            <field name="model">sale.opportunity.reporting.conversion</field>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_reporting_conversion_sale">
            <field name="model">sale.opportunity.reporting.conversion</field>
            <field name="group" ref="sale.group_sale"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_time_series_view_list">
            <field name="model">sale.opportunity.reporting.conversion.time_series</field>
            <field name="type">tree</field>
            <field name="name">opportunity_reporting_conversion_time_series_list</field>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_time_series_view_graph_number">
            <field name="model">sale.opportunity.reporting.conversion.time_series</field>
            <field name="type" eval="None"/>
            <field name="inherit" ref="reporting_conversion_view_graph_number"/>
            <field name="name">opportunity_reporting_conversion_time_series_graph_number</field>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_time_series_view_graph_amount">
            <field name="model">sale.opportunity.reporting.conversion.time_series</field>
            <field name="type" eval="None"/>
            <field name="inherit" ref="reporting_conversion_view_graph_amount"/>
            <field name="name">opportunity_reporting_conversion_time_series_graph_amount</field>
        </record>

        <record model="ir.action.act_window" id="act_reporting_conversion_time_series">
            <field name="name">Opportunity Conversions</field>
            <field name="res_model">sale.opportunity.reporting.conversion.time_series</field>
            <field name="context_model">sale.opportunity.reporting.context</field>
            <field name="order" eval="[('date', 'DESC')]" pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_time_series_list_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="reporting_conversion_time_series_view_list"/>
            <field name="act_window" ref="act_reporting_conversion_time_series"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_time_series_list_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="reporting_conversion_time_series_view_graph_number"/>
            <field name="act_window" ref="act_reporting_conversion_time_series"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_time_series_list_view3">
            <field name="sequence" eval="30"/>
            <field name="view" ref="reporting_conversion_time_series_view_graph_amount"/>
            <field name="act_window" ref="act_reporting_conversion_time_series"/>
        </record>
        <record model="ir.action.keyword" id="act_reporting_conversion_time_series_list_keyword1">
            <field name="keyword">tree_open</field>
            <field name="model">sale.opportunity.reporting.conversion,-1</field>
            <field name="action" ref="act_reporting_conversion_time_series"/>
        </record>

        <record model="ir.rule.group" id="rule_group_reporting_conversion_time_series_companies">
            <field name="name">User in companies</field>
            <field name="model">sale.opportunity.reporting.conversion.time_series</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_reporting_conversion_time_series_companies">
            <field
                name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_reporting_conversion_time_series_companies"/>
        </record>

        <record model="ir.model.access" id="access_reporting_conversion_time_series">
            <field name="model">sale.opportunity.reporting.conversion.time_series</field>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_reporting_conversion_time_series_sale">
            <field name="model">sale.opportunity.reporting.conversion.time_series</field>
            <field name="group" ref="sale.group_sale"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>

        <!-- Conversion Employee -->

        <record model="ir.ui.view" id="reporting_conversion_employee_view_list">
            <field name="model">sale.opportunity.reporting.conversion.employee</field>
            <field name="type" eval="None"/>
            <field name="inherit" ref="reporting_conversion_view_list"/>
            <field name="name">opportunity_reporting_conversion_employee_list</field>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_employee_view_graph_number">
            <field name="model">sale.opportunity.reporting.conversion.employee</field>
            <field name="type" eval="None"/>
            <field name="inherit" ref="reporting_conversion_view_graph_number"/>
            <field name="name">opportunity_reporting_conversion_employee_graph_number</field>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_employee_view_graph_amount">
            <field name="model">sale.opportunity.reporting.conversion.employee</field>
            <field name="type" eval="None"/>
            <field name="inherit" ref="reporting_conversion_view_graph_amount"/>
            <field name="name">opportunity_reporting_conversion_employee_graph_amount</field>
        </record>

        <record model="ir.action.act_window" id="act_reporting_conversion_employee">
            <field name="name">Opportunity Conversions per Employee</field>
            <field name="res_model">sale.opportunity.reporting.conversion.employee</field>
            <field name="context_model">sale.opportunity.reporting.context</field>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_employee_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="reporting_conversion_employee_view_list"/>
            <field name="act_window" ref="act_reporting_conversion_employee"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_employee_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="reporting_conversion_employee_view_graph_number"/>
            <field name="act_window" ref="act_reporting_conversion_employee"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_employee_view3">
            <field name="sequence" eval="30"/>
            <field name="view" ref="reporting_conversion_employee_view_graph_amount"/>
            <field name="act_window" ref="act_reporting_conversion_employee"/>
        </record>
        <record model="ir.action.keyword" id="act_reporting_conversion_employee_keyword1">
            <field name="keyword">tree_open</field>
            <field name="model" ref="menu_reporting_opportunity"/>
            <field name="action" ref="act_reporting_conversion_employee"/>
        </record>
        <record model="ir.action.keyword" id="act_reporting_conversion_employee_keyword2">
            <field name="keyword">tree_open</field>
            <field name="model">sale.opportunity.reporting.conversion,-1</field>
            <field name="action" ref="act_reporting_conversion_employee"/>
        </record>

        <record model="ir.rule.group" id="rule_group_reporting_conversion_employee_companies">
            <field name="name">User in companies</field>
            <field name="model">sale.opportunity.reporting.conversion.employee</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_reporting_conversion_employee_companies">
            <field
                name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_reporting_conversion_employee_companies"/>
        </record>

        <record model="ir.model.access" id="access_reporting_conversion_employee">
            <field name="model">sale.opportunity.reporting.conversion.employee</field>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_reporting_conversion_employee_sale">
            <field name="model">sale.opportunity.reporting.conversion.employee</field>
            <field name="group" ref="sale.group_sale"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_employee_time_series_view_list">
            <field name="model">sale.opportunity.reporting.conversion.employee.time_series</field>
            <field name="type">tree</field>
            <field name="name">opportunity_reporting_conversion_time_series_list</field>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_employee_time_series_view_graph_number">
            <field name="model">sale.opportunity.reporting.conversion.employee.time_series</field>
            <field name="type">graph</field>
            <field name="name">opportunity_reporting_conversion_time_series_graph_number</field>
        </record>

        <record model="ir.ui.view" id="reporting_conversion_employee_time_series_view_graph_amount">
            <field name="model">sale.opportunity.reporting.conversion.employee.time_series</field>
            <field name="type">graph</field>
            <field name="name">opportunity_reporting_conversion_time_series_graph_amount</field>
        </record>

        <record model="ir.action.act_window" id="act_reporting_conversion_employee_time_series">
            <field name="name">Opportunity Conversions per Employee</field>
            <field name="res_model">sale.opportunity.reporting.conversion.employee.time_series</field>
            <field name="context_model">sale.opportunity.reporting.context</field>
            <field
                name="domain"
                eval="[('employee', '=', Eval('active_id', -1))]"
                pyson="1"/>
            <field name="order" eval="[('date', 'DESC')]" pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_employee_time_series_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="reporting_conversion_employee_time_series_view_list"/>
            <field name="act_window" ref="act_reporting_conversion_employee_time_series"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_employee_time_series_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="reporting_conversion_employee_time_series_view_graph_number"/>
            <field name="act_window" ref="act_reporting_conversion_employee_time_series"/>
        </record>
        <record model="ir.action.act_window.view" id="act_reporting_conversion_employee_time_series_view3">
            <field name="sequence" eval="30"/>
            <field name="view" ref="reporting_conversion_employee_time_series_view_graph_amount"/>
            <field name="act_window" ref="act_reporting_conversion_employee_time_series"/>
        </record>
        <record model="ir.action.keyword" id="act_reporting_conversion_employee_time_series_keyword1">
            <field name="keyword">tree_open</field>
            <field name="model">sale.opportunity.reporting.conversion.employee,-1</field>
            <field name="action" ref="act_reporting_conversion_employee_time_series"/>
        </record>

        <record model="ir.rule.group" id="rule_group_reporting_conversion_employee_time_series_companies">
            <field name="name">User in companies</field>
            <field name="model">sale.opportunity.reporting.conversion.employee.time_series</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_reporting_conversion_employee_time_series_companies">
            <field
                name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_reporting_conversion_employee_time_series_companies"/>
        </record>

        <record model="ir.model.access" id="access_reporting_conversion_employee_time_series">
            <field name="model">sale.opportunity.reporting.conversion.employee.time_series</field>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_reporting_conversion_employee_time_series_sale">
            <field name="model">sale.opportunity.reporting.conversion.employee.time_series</field>
            <field name="group" ref="sale.group_sale"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
    </data>
</tryton>
