Hello,

> I have do divide partners an partner contatcs by main companies. A logged
> in user who is part of main company A should only be able to see the
> partners and partner contacts which were created by a user who is part of
> main company A. So if I have two main companies (A and B) with assigned
> users which create partners and partner contacts, users of main company A
> should only see their partners and contacts and vice versa.
>
> In the first step I tried to divide partners with one of the record rules
> on res.partner
>
> [('parent_id','=','User/Company')]
> [('parent_id','=','User/Company/Company Name')]
>
> but this records did not have the desired effect.


I solved this with a non global redord rule on res.partner like
[('user_id','=','User')]
This record rule is applied on group A which holds all users of main company 
A. Now if user A1 is member of group A and if he is assigned as salesman to a 
company he can see this company otherwise not. This is not ideal but works 
for me.

> Next I looked in res.partner.address for a suitable field to filter partner
> contacts like described above but at the moment I have no idea how this can
> be accomplished.

I have no clue how to solve this problem. Since I found no suitable field in 
res.partner.address to filter contacts by write_uid I tried to create a new 
resource like

Name:              write_uid
Model id:          res.partner.address
Field Description: User
Field Type:        many2one
Model Relation:    res.partner

to establish a record rule for a group like
[('write_uid','=','User')]

Unfortunately this raises the error "NULL in column "model_id" violated 
Not-Null-Constraint".

My question is: did I try impossible things or am I on the right track?

Any hint is appreciated.
_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman/listinfo/tinyerp-users

Reply via email to