diff --git a/odex25_hr/hr_base/models/hr_department.py b/odex25_hr/hr_base/models/hr_department.py index 57ad5e5dd..d5d0dd9c5 100644 --- a/odex25_hr/hr_base/models/hr_department.py +++ b/odex25_hr/hr_base/models/hr_department.py @@ -49,6 +49,10 @@ class HrDepartment(models.Model): will be changed for all employees has with this department""" for rec in self: super(HrDepartment, rec).write(vals) + ## to remove followers ## + followers = self.env['mail.followers'].search([('res_id', '=', rec.id),('res_model','=','hr.department')]) + followers.sudo().unlink() + ### end ################# if ('manager_id' or 'parent_id' in vals): employees = rec.env['hr.employee'].search([('department_id', '=', rec.id)]) for emp in employees: