an employee replace_employee use the same access rights and rules as parent_id (direct manager)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



an employee replace_employee use the same access rights and rules as parent_id (direct manager)



enter image description hereI want the field replace_employee_id to have the same access rights and rules as parent_id (direct manager)
I create a new object hr.delegacy (تفويض) contains( employee_id and employee_replace_id)
I add a field in replace_employee_id in object hr.employee


parent_id = fields.Many2one('hr.employee', string='employee')
replace_employee_id = fields.Many2one('hr.employee', string='replace employee')



after confirm I set the value of replace_employee_id to employee_replace_id


@api.multi
def action_confirm(self):
"""اعتمدت."""
employee = self.env['hr.employee'].search([('id', '=', self.employee_id.id)])
for delegacy in self:
employee.replace_employee_id = delegacy.employee_replace_id



i want replace_employee_id to have the same rules as parent_id in the object hr.holidays ' to see the same holidays) in the security of hr.holidays i write ['|','|',('employee_id.parent_id.user_id','=',user.id),('employee_id.user_id','=',user.id),('employee_id.parent_id','=',user.employee_ids[0].replace_employee_id.id)]"


['|','|',('employee_id.parent_id.user_id','=',user.id),('employee_id.user_id','=',user.id),('employee_id.parent_id','=',user.employee_ids[0].replace_employee_id.id)]"



but it show me error in 'employee_id.parent_id','=',user.employee_ids[0].replace_employee_id.id)


'employee_id.parent_id','=',user.employee_ids[0].replace_employee_id.id)



How can I correct it?





Please add the error message
– CZoellner
Aug 6 at 9:41





when i print rec.employee_id.parent_id.replace_employee_id it show me false. i add a picture in the top
– user9959051
Aug 6 at 10:30










By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard