<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">

    <record id="base.group_sale_salesman" model="res.groups">
        <field name="name">User: Own Leads Only</field>
        <field name="category_id" ref="base.module_category_sales_management"/>
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
        <field name="comment">the user will have access to his own data in the sales application.</field>
    </record>

    <record id="base.group_sale_salesman_all_leads" model="res.groups">
        <field name="name">User: All Leads</field>
        <field name="category_id" ref="base.module_category_sales_management"/>
        <field name="implied_ids" eval="[(4, ref('base.group_sale_salesman'))]"/>
        <field name="comment">the user will have access to all records of everyone in the sales application.</field>
    </record>

    <record id="base.group_sale_manager" model="res.groups">
        <field name="name">Manager</field>
        <field name="comment">the user will have an access to the sales configuration as well as statistic reports.</field>
        <field name="category_id" ref="base.module_category_sales_management"/>
        <field name="implied_ids" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
        <field name="users" eval="[(4, ref('base.user_root'))]"/>
    </record>

    <record id="group_fund_raising" model="res.groups">
        <field name="name">Manage Fund Raising</field>
        <field name="category_id" ref="base.module_category_hidden"/>
    </record>

    <record id="group_scheduled_calls" model="res.groups">
        <field name="name">Show Scheduled Calls Menu</field>
        <field name="category_id" ref="base.module_category_hidden"/>
    </record>

    <record model="res.users" id="base.user_root">
        <field eval="[(4,ref('base.group_partner_manager'))]" name="groups_id"/>
    </record>

    <record model='ir.ui.menu' id='base.menu_base_partner'>
        <field name="groups_id" eval="[(4,ref('base.group_sale_manager')),(4,ref('base.group_sale_salesman'))]"/>
    </record>

    <record model="ir.ui.menu" id="base.menu_base_config">
        <field eval="[(4, ref('base.group_sale_manager'))]" name="groups_id"/>
    </record>

</data>

<data noupdate="1">

    <record id="crm_rule_personal_lead" model="ir.rule">
        <field name="name">Personal Leads</field>
        <field ref="model_crm_lead" name="model_id"/>
        <field name="domain_force">['|',('user_id','=',user.id),('user_id','=',False)]</field>
        <field name="groups" eval="[(4, ref('base.group_sale_salesman'))]"/>
    </record>
    <record id="crm_rule_all_lead" model="ir.rule">
        <field name="name">All Leads</field>
        <field ref="model_crm_lead" name="model_id"/>
        <field name="domain_force">[(1,'=',1)]</field>
        <field name="groups" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
    </record>

    <record id="calendar_event_global" model="ir.rule">
        <field name="name">Hide Private Meetings</field>
        <field ref="model_calendar_event" name="model_id"/>
        <field eval="1" name="global"/>
        <field name="domain_force">['|',('user_id','=',user.id),('show_as','=','busy')]</field>
    </record>

    <record id="crm_rule_personal_phonecall" model="ir.rule">
        <field name="name">Personal Phone Calls</field>
        <field ref="model_crm_phonecall" name="model_id"/>
        <field name="domain_force">['|',('user_id','=',user.id),('user_id','=',False)]</field>
        <field name="groups" eval="[(4, ref('base.group_sale_salesman'))]"/>
    </record>
    <record id="crm_rule_all_phones" model="ir.rule">
        <field name="name">All Phones</field>
        <field ref="model_crm_phonecall" name="model_id"/>
        <field name="domain_force">[(1,'=',1)]</field>
        <field name="groups" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
    </record>

    <record id="crm_rule_personal_lead_report" model="ir.rule">
        <field name="name">Personal Leads Analysis</field>
        <field ref="model_crm_lead_report" name="model_id"/>
        <field name="domain_force">['|',('user_id','=',user.id),('user_id','=',False)]</field>
        <field name="groups" eval="[(4, ref('base.group_sale_salesman'))]"/>
    </record>

    <record id="crm_rule_all_lead_report" model="ir.rule">
        <field name="name">All Leads Analysis</field>
        <field ref="model_crm_lead_report" name="model_id"/>
        <field name="domain_force">[(1,'=',1)]</field>
        <field name="groups" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
    </record>

</data>
</openerp>
