flectra/addons/crm/report/crm_activity_report_views.xml
2018-01-16 02:34:37 -08:00

83 lines
4.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<record id="crm_activity_report_view_graph" model="ir.ui.view">
<field name="name">crm.activity.report.graph</field>
<field name="model">crm.activity.report</field>
<field name="arch" type="xml">
<graph string="Activities Analysis" stacked="True">
<field name="mail_activity_type_id" type="col"/>
<field name="date" interval="month" type="row"/>
</graph>
</field>
</record>
<record id="crm_activity_report_view_pivot" model="ir.ui.view">
<field name="name">crm.activity.report.pivot</field>
<field name="model">crm.activity.report</field>
<field name="arch" type="xml">
<pivot string="Activities Analysis" disable_linking="True">
<field name="mail_activity_type_id" type="col"/>
<field name="date" interval="month" type="row"/>
</pivot>
</field>
</record>
<record id="crm_activity_report_view_search" model="ir.ui.view">
<field name="name">crm.activity.report.search</field>
<field name="model">crm.activity.report</field>
<field name="arch" type="xml">
<search string="Activities Analysis">
<filter string="My Activities" name="activities_my" domain="[('user_id', '=', uid)]"/>
<separator/>
<filter name="lead" string="Leads" domain="[('lead_type','=', 'lead')]" help="Show only lead"/>
<filter name="opportunity" string="Opportunities" domain="[('lead_type','=','opportunity')]" help="Show only opportunity"/>
<separator/>
<filter string="Won" name="won"
domain="['&amp;', ('stage_id.probability', '=', 100), ('stage_id.on_change', '=', 1)]"/>
<separator/>
<filter string="This Month" name="this_month" domain="[('date', '&gt;=', context_today().strftime('%%Y-%%m-01'))]"/>
<filter string="Last Month" name="last_month" domain="['&amp;', ('date', '&gt;=', (context_today() - relativedelta(months=1)).strftime('%%Y-%%m-01')), ('date', '&lt;', context_today().strftime('%%Y-%%m-01'))]"/>
<field name="team_id" context="{'invisible_team': False}"/>
<field name="author_id" string="Created By"/>
<group expand="1" string="Group By">
<filter string="Created By" name="group_by_salesperson" context="{'group_by':'author_id'}"/>
<filter string="Sales Channel" context="{'group_by':'team_id'}"/>
<filter string="Country" context="{'group_by':'country_id'}" />
<filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Stage" context="{'group_by':'stage_id'}"/>
<filter string="Month" context="{'group_by':'date:month'}" name="month"/>
<filter string="Leads" name="group_by_opportunity" context="{'group_by':'lead_id'}" />
</group>
</search>
</field>
</record>
<record id="crm_activity_report_action" model="ir.actions.act_window">
<field name="name">Activities Analysis</field>
<field name="res_model">crm.activity.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,pivot</field>
<field name="context">{'search_default_activities_my': True}</field>
<field name="domain">[]</field>
</record>
<menuitem
id="crm_activity_report_menu"
name="Activities"
groups="sales_team.group_sale_manager"
parent="crm_menu_report"
action="crm_activity_report_action"
sequence="6"/>
<record id="crm_activity_report_action_team" model="ir.actions.act_window">
<field name="name">Activities Analysis</field>
<field name="res_model">crm.activity.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,pivot</field>
<field name="context">{'search_default_team_id': active_id}</field>
<field name="domain">[]</field>
</record>
</flectra>