Skip to content
Extraits de code Groupes Projets
Valider e6429768 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[UPD] action_send_end_training_data: add filter for present students

parent 0c2d9dbc
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -88,7 +88,14 @@ class Training(models.Model): ...@@ -88,7 +88,14 @@ class Training(models.Model):
self.ensure_one() self.ensure_one()
self.action_done() self.action_done()
end_template_id = self.env.ref("training_survey.mail_template_training_end") end_template_id = self.env.ref("training_survey.mail_template_training_end")
student_ids = self.student_ids.filtered(lambda s: s.state == "confirmed") student_ids = self.student_ids.filtered(
lambda s: s.state == "confirmed"
and any(
s.student_slot_ids.mapped(
lambda slot: True if slot.state == "present" else False
)
)
)
for student in student_ids: for student in student_ids:
aect_answer = student._create_answer(self.aect_survey_id) aect_answer = student._create_answer(self.aect_survey_id)
satisfaction_answer = student._create_answer(self.satisfaction_survey_id) satisfaction_answer = student._create_answer(self.satisfaction_survey_id)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter