Hi all,
Finally, I've got something up and running.

Objective: Filter partners depending on user's departments

Pre-requisites: Module hr installed

How to:
1) Create a relationship many2many Partner-Department
2) Add field "department_ids" to object user (same as hr.department.members)
3) Create a record rule on Partner object where:
 - Partner.departments in User.departments

This solution filters partners in any part of the framework by user's 
departments.

Thanks Kristoff for your help though, eventually, we decided it was better to 
restrict access on the object itself rather than in the view. Anyway, I learned 
a good deal with the code you suggested me. 


As a side effect, now in "Partner Addresses" we have an "Access Denied" string 
for all partners no matter if they are accesible by the user or not. But that's 
for season 2 of "Partner Visibility".

If anyone is interested in the code, I could upload it here later.

Cheers,

Jose A. Corbacho




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=50497#50497

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to