<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2021 Sygel - Valentin Vinagre
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="partner_view_crm_salesperson_planner" model="ir.ui.view">
        <field name="name">partner.view.crm.salesperson.planner</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form" />
        <field name="arch" type="xml">
            <xpath expr="//div[@name='button_box']" position="inside">
                <button
                    class="oe_stat_button"
                    type="object"
                    name="action_view_salesperson_planner_visit"
                    icon="fa-building"
                    groups="sales_team.group_sale_salesman"
                    context="{'default_partner_id': active_id}"
                >
                    <field
                        string="Sales Visits"
                        name="salesperson_planner_visit_count"
                        widget="statinfo"
                    />
                </button>
            </xpath>
        </field>
    </record>
</odoo>
