In my OpenERP 7 solution, there is a custom Purchase Order approval system that I have implemented through the PO Workflow.
But now I am stuck on another custom need. The scenario is a manager will be able to view only those Requested Purchase order which are made by his Subordinates, actually as approval Que. Subordinates are defined in HR Module.
I tried in following ways:
- creating a Record Rule under Security. But to write the domain code to filter, I only have PurchaseOrder Objects whose field is 'created_uid' and a logged in User Object. Logged in User object doesn't have any relation that can help fine the subordinates. I mean, User object doesn't contains who is a manager or subordinates of this logged in user. So, I have created a field in res.users model in relation with child_ids of hr_employee model. But it doesn't preloaded in logged in Users object.
- creating a custom window action. But same problem for domain code. Just could not find any way to filter the subordinates.
I just don't know what should be the code in domain for filtering the POs which are made by the subordinates of a logged in manager.
any kind of help will be appreciable
Thanks in advance :)