fix department child_of

This commit is contained in:
Bakry 2024-10-13 13:37:42 +03:00
parent 16c8ac90c5
commit 2156bc09a1
1 changed files with 2 additions and 1 deletions

View File

@ -54,7 +54,8 @@ class HrDepartment(models.Model):
followers.sudo().unlink()
### end #################
if ('manager_id' or 'parent_id' in vals):
employees = rec.env['hr.employee'].search([('department_id', '=', rec.id)])
departments = rec.env['hr.department'].search([('id', 'child_of', rec.id)]).ids
employees = rec.env['hr.employee'].search([('department_id', 'in', departments)])
for emp in employees:
emp._onchange_department()
if rec.dep_link: