How to set a read,write access on object using record rules

Asked by pritesh

Hello

can anyone tell regarding how to set a read and write access on specific rule for any object.

i want achieve a following scenario in openerp crm.lead module

   1. Sales man should not be able to edit the lead information which are assigned to other sales man of same team but able to view the lead information

I have done following configuration in my db

    * created a users sales1,sales2,sales3 and sales4
    * created two sales team -team1,team2
    * sales1,sales2 belong to team1
    * sales3,sales4 belong to team2

create a group name salesman dept
and assign crm.lead and other objects access rights as -read,write,create,delete

Now create a Record rules assign to group salesman dept

   1. create a rule with object =crm.lead and all rights(r,w,c,d) and domain=['|',('user_id','=',user.id),('section_id','=',[user.context_section_id.id])]

with above configuration

i can achieve following scenario

-each member of salesman can only see his/her salesman team data but they can also able to edit other salesman data .

Now for making actual scenario i tried following rule and append to same group but still not able to achieve....

1- create a rule with object =crm.lead then only read right
and set a domain=['&',('user_id','!=',user.id),('section_id','=',[user.context_section_id.id])]

Thanks
pritesh

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
digitalsatori(Shine IT) (digitalsatori) said :
#1

I guess you need 2 record rules for your purpose:
rule1 object =crm.lead and rights(r) and domain=['|',('user_id','=',user.id
),('section_id','=',[user.context_section_id.id])] -readonly access
rule2 object =crm.lead and rights(r,w,c,d) and domain=['|('user_id','=',
user.id)] -full
access

On Tue, Nov 15, 2011 at 3:05 AM, pritesh <
<email address hidden>> wrote:

> New question #178760 on OpenERP Server:
> https://answers.launchpad.net/openobject-server/+question/178760
>
> Hello
>
> can anyone tell regarding how to set a read and write access on specific
> rule for any object.
>
> i want achieve a following scenario in openerp crm.lead module
>
> 1. Sales man should not be able to edit the lead information which are
> assigned to other sales man of same team but able to view the lead
> information
>
> I have done following configuration in my db
>
> * created a users sales1,sales2,sales3 and sales4
> * created two sales team -team1,team2
> * sales1,sales2 belong to team1
> * sales3,sales4 belong to team2
>
> create a group name salesman dept
> and assign crm.lead and other objects access rights as
> -read,write,create,delete
>
> Now create a Record rules assign to group salesman dept
>
> 1. create a rule with object =crm.lead and all rights(r,w,c,d) and
> domain=['|',('user_id','=',user.id),('section_id','=',[
> user.context_section_id.id])]
>
>
> with above configuration
>
> i can achieve following scenario
>
> -each member of salesman can only see his/her salesman team data but they
> can also able to edit other salesman data .
>
>
> Now for making actual scenario i tried following rule and append to same
> group but still not able to achieve....
>
> 1- create a rule with object =crm.lead then only read right
> and set a domain=['&',('user_id','!=',user.id),('section_id','=',[
> user.context_section_id.id])]
>
>
>
> Thanks
> pritesh
>
>
>
>
>
>
> --
> You received this question notification because you are a member of
> OpenERP Committers, which is an answer contact for OpenERP Server.
>

Can you help with this problem?

Provide an answer of your own, or ask pritesh for more information if necessary.

To post a message you must log in.