<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="module_category_crm_crm" model="ir.module.category">
        <field name="name">CRM</field>
        <field name="parent_id" ref="base.module_category_sales" />
    </record>
    <record id="group_crm_own_leads" model="res.groups">
        <field name="name">User: Own Documents Only</field>
        <field name="category_id" ref="crm_security_group.module_category_crm_crm" />
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
    </record>
    <record id="group_crm_all_leads" model="res.groups">
        <field name="name">User: All Documents</field>
        <field name="category_id" ref="crm_security_group.module_category_crm_crm" />
        <field
            name="implied_ids"
            eval="[(4, ref('crm_security_group.group_crm_own_leads'))]"
        />
    </record>
    <record id="group_crm_manager" model="res.groups">
        <field name="name">Administrator</field>
        <field name="category_id" ref="crm_security_group.module_category_crm_crm" />
        <field
            name="implied_ids"
            eval="[(4, ref('crm_security_group.group_crm_all_leads'))]"
        />
        <field
            name="users"
            eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
        />
    </record>
    <data noupdate="1">
        <record id="crm_personal_rule" model="ir.rule">
            <field name="name">Personal Leads</field>
            <field name="model_id" ref="crm.model_crm_lead" />
            <field
                name="domain_force"
            >['|',('user_id','=',user.id),('user_id','=',False)]</field>
            <field
                name="groups"
                eval="[(4, ref('crm_security_group.group_crm_own_leads'))]"
            />
        </record>
        <record id="crm_see_all" model="ir.rule">
            <field name="name">All Leads</field>
            <field name="model_id" ref="crm.model_crm_lead" />
            <field name="domain_force">[(1,'=',1)]</field>
            <field
                name="groups"
                eval="[(4, ref('crm_security_group.group_crm_all_leads'))]"
            />
        </record>
    </data>
</odoo>
