remove followers from Department
This commit is contained in:
parent
733d34d67d
commit
5ec1e48aee
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue