<?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 noupdate="1">
    <record id="crm_salesperson_planner_visit_comp_rule" model="ir.rule">
        <field name="name">CRM Salesperson planner visit multi-company</field>
        <field name="model_id" ref="model_crm_salesperson_planner_visit" />
        <field name="global" eval="True" />
        <field
            name="domain_force"
        >['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
    </record>
    <record id="crm_salesperson_planner_visit_template_comp_rule" model="ir.rule">
        <field name="name">CRM Salesperson planner visit template multi-company</field>
        <field name="model_id" ref="model_crm_salesperson_planner_visit" />
        <field name="global" eval="True" />
        <field
            name="domain_force"
        >['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
    </record>
    <record id="personal_salesperson_planner_visit" model="ir.rule">
        <field name="name">Personal Salesperson Planner Visit</field>
        <field ref="model_crm_salesperson_planner_visit" name="model_id" />
        <field
            name="domain_force"
        >['|',('user_id','=',user.id),('user_id','=',False)]</field>
        <field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]" />
    </record>
    <record id="all_salesperson_planner_visit" model="ir.rule">
        <field name="name">All Salesperson Planner Visit</field>
        <field ref="model_crm_salesperson_planner_visit" name="model_id" />
        <field name="domain_force">[(1,'=',1)]</field>
        <field
            name="groups"
            eval="[(4, ref('sales_team.group_sale_salesman_all_leads'))]"
        />
    </record>
    <record id="personal_salesperson_planner_visit_template" model="ir.rule">
        <field name="name">Personal Salesperson Planner Visit Template</field>
        <field ref="model_crm_salesperson_planner_visit_template" name="model_id" />
        <field
            name="domain_force"
        >['|',('user_id','=',user.id),('user_id','=',False)]</field>
        <field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]" />
    </record>
    <record id="all_salesperson_planner_visit_template" model="ir.rule">
        <field name="name">All Salesperson Planner Visit Template</field>
        <field ref="model_crm_salesperson_planner_visit_template" name="model_id" />
        <field name="domain_force">[(1,'=',1)]</field>
        <field
            name="groups"
            eval="[(4, ref('sales_team.group_sale_salesman_all_leads'))]"
        />
    </record>
</odoo>
