From 055ceede53d9ea6b12917bad5306fa34d9536664 Mon Sep 17 00:00:00 2001 From: Marc Durepos Date: Thu, 27 Feb 2025 14:52:16 -0500 Subject: [PATCH] fsm_visit_confirmation: only send email for top-level tasks --- fsm_visit_confirmation/models/project_task.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fsm_visit_confirmation/models/project_task.py b/fsm_visit_confirmation/models/project_task.py index 3e29fc8..d7f283d 100644 --- a/fsm_visit_confirmation/models/project_task.py +++ b/fsm_visit_confirmation/models/project_task.py @@ -13,9 +13,11 @@ class ProjectTask(models.Model): # If stage changed and new stage has an approval template, send the email if "stage_id" in vals: + # Only send email for top-level tasks for task in self.filtered( lambda task: task.stage_id != old_stages[task.id] and task.stage_id.approval_template_id + and not task.parent_id ): task._portal_ensure_token() task.stage_id.approval_template_id.send_mail(