Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to filter contacts based on the hr departments?

By
vivek
on 4/26/13, 4:03 PM 965 views

Hi all,

My question is simple, yet i don't know the answer!!.

I want to create 4 generic groups and assign users to it.

Group Name - Group Description

  • Own Contacts - Users assigned to this group will only be able to see their own contacts
  • Team Contacts - Users assigned to this group will be able to see their own contacts and their group(sub-department) contacts
  • Department Contacts - Users assigned to this group will be able to see their own contacts and their department contacts
  • All Contacts - Users assigned to this group will be able to see all the system contacts

I have created 3 departments in hr module each with a manager

Department - Manager

  • Sales - Leo
  • Sales Team 1 - James
  • Sales Team 2 - Edward Every one has got a related user login and will be able to login to the system.

Now i would like to do implement the following logics in openerp for my groups

Own Contacts - create_uid = context.get('uid') - Works Fine

Team Contacts - create_uid.employee_id.dpt_id = context.get('uid').employee_id.dpt_id - need something like this

Department Contacts - create_uid.employee_id.dpt_id is a sub-department of context.get('uid').employee_id.dpt_id - need something like this

All Contacts - 1=1 - should work fine.

Thanks a lot if you can help me with this issue. Thanks.

Meantime, i've tried to execite this [user.rel_employee.department_id] and got the following error "NotImplementedError("Iteration is not allowed on %s" % self)". It seems that openerp's Record rule functionalities doesn't allow iteration. In that case i can't implement the above logic with record rules. Need to find some other way-out.

vivek
on 4/27/13, 10:41 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 4/26/13, 4:03 PM
Seen: 965 times
Last updated: 3/16/15, 8:10 AM