diff --git a/project_ux/models/project_task.py b/project_ux/models/project_task.py index bba67afd..4de2623e 100644 --- a/project_ux/models/project_task.py +++ b/project_ux/models/project_task.py @@ -19,6 +19,11 @@ class Task(models.Model): def _track_template(self, changes): task = self[0] res = super()._track_template(changes) + if 'stage_id' in changes and task.stage_id.mail_template_id: + res['stage_id'] = (task.stage_id.mail_template_id, { + 'message_type': 'comment', + 'auto_delete_message': True, + 'email_layout_xmlid': 'mail.mail_notification_light'}) if 'stage_id' in res and task.dont_send_stage_email and task.stage_id.mail_template_id: res.pop('stage_id') task.dont_send_stage_email = False