콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
5683 화면

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

아바타
취소
베스트 답변

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.

아바타
취소
작성자 베스트 답변

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 ?

아바타
취소
관련 게시물 답글 화면 활동
1
6월 24
1438
3
3월 15
4255
7
11월 20
24871
11
1월 19
9854
1
12월 22
4032