Community mailing list archives

community@mail.odoo.com

Record Rules depends on many2many fields?

by
Dion Martin
- 06/24/2015 02:45:51
Dear Community,

We are setting up record rules for one of our client. Please give me some advice if you have done same case below:

Sales manager manages more than one sales team. Thus, he should be able to see all Quotations/Sale Orders owned by salesman under his team. We've added new many2many fields on res.users (relation object: crm.case.section)
'team_ids': fields.many2many('crm.case.section', 'sale_member_rel', 'member_id', 'section_id', 'Teams')

So, what is the rule that I have to set on Domain? We've tried these domains with no luck:
[('section_id','child_of',[user.team_ids.id])]
[('section_id','in',[user.team_ids.id])]
[('section_id','=',user.team_ids.id)]

Please share your valuable experiences..

Best regards,
Dion