Jack Sparrow
Jack Sparrow

Reputation: 666

OpenERP 7 Access Rights for sales team lead

i have created two record rules for opportunities and sales order in first i want only team lead to see all the leads of his team and in second i want only draft state sale orders to show any user.

So have created two record rules this are as follows can someone help me the same is not working properly only sales person is allow to see leads team lead is not allowed.

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="sale_security_opportunities" model="ir.rule">
            <field name="name">See Teams Leads</field>
            <field name="model_id" ref="crm.model_crm_lead"/>
            <field name="global" eval="True"/>
            <field name="domain_force">['&amp;','|','|',('section_id.user_id','=',user.id), ('section_id.member_ids', 'in', [user.id]),('user_id','=',user.id),('user_id','=',False)]</field>

        </record>
        <!--For See Only Quatations Group And Record Rule-->


        <record id="group_see_only_quotation" model="res.groups">
            <field name="name">See Only Quotation</field>
            <field name="comment">Thsi User Can Only Leads,Opportunities and Quotations.</field>
        </record>

        <record id="sale_security_sale_quatation" model="ir.rule">
            <field name="name">Quotation Only</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="global" eval="True"/>
            <field name="domain_force">[('state','=','draft')]</field>
            <field name="groups" eval="[(4,ref('my_module.group_see_only_quotation'))]"/>
        </record>


    </data>
</openerp>

Upvotes: 1

Views: 135

Answers (0)

Related Questions