<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="sale_report_view_form" model="ir.ui.view">
        <field name="name">sale.report.partner_sale_pivot</field>
        <field name="model">sale.report</field>
        <field name="arch" type="xml">
            <pivot disable_linking="True">
                <field name="date" interval="month" type="col" />
                <field name="product_id" type="row" />
                <field name="price_subtotal" type="measure" />
            </pivot>
        </field>
    </record>

    <record id="sale_report_action" model="ir.actions.act_window">
        <field name="name">Sales Analysis</field>
        <field name="res_model">sale.report</field>
        <field name="view_mode">pivot</field>
        <field name="path">sales-analysis</field>
        <field name="context">{'search_default_partner_id': active_id}</field>
        <field name="domain">[('state', 'in', ['sale', 'done'])]</field>
        <field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]" />
        <field name="view_id" ref="sale_report_view_form" />
    </record>
</odoo>
