Odoo Help


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.


Filter purchase by employee and department

on 2/17/15, 1:07 PM 562 views

Hi ,

I search to filter purchases linked to hr addon (by employee)

My employees and departments are :
- Boss 1 (department 1)
    - user 1
    - user 2
- Boss 2 (department 2)
    - user 3
    - user 4

Each user can make purchase (group purchase / user).

I want that each user could just see his purchases - this is ok by filter domain (‘create_uid’ , '=' , uid) - and the Boss could see all purchases of his department (and only his department)

Thanks for your help



| 5 3 6
Jakarta, Indonesia
On 2/17/15, 2:03 PM

I think you need to first add department_id to purchase.order model, then add (through related/function) the department's manager_id as well then filter by that.  The department_id can be a related/functional field but I think it is saver to put it as a normal field that will be defaulted by the requestor's department.  This way, the purchase will remain in the same department although the requestor has moved to another department.

On 2/17/15, 5:29 PM

Thanks Ivan,

Ok for adding field department_id to purchase.order model.
If I understand, I get the department’s manager_id when user make his purchase, and I write it into the new field ?
But how can I get this ? It does not seem to have rel between user and employee.
Could you help me for this function ?

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

1 follower(s)


Asked: 2/17/15, 1:07 PM
Seen: 562 times
Last updated: 3/16/15, 8:10 AM