From 04861eaf9e353d51da6bc9d08ba5a9e78ea34c5a Mon Sep 17 00:00:00 2001 From: Leonardo Pavan Rocha Date: Mon, 14 Mar 2022 13:53:55 +0000 Subject: [PATCH] [IMP] hr_contract: disable email when a contract is about to end When a contract is about to end, an activity is scheduled for the hr responsible to act on it. Also, from task 2759601, a new warning was created showing the contracts that are about to end. Therefore, sending an email to the hr responsible started being too intrusive. This commit drops the email sending for this case. task-2759601 closes odoo/odoo#86379 Related: odoo/upgrade#3359 Related: odoo/enterprise#24287 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_contract/models/hr_contract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_contract/models/hr_contract.py b/addons/hr_contract/models/hr_contract.py index 0c3a6877a68..f107a3f3c03 100644 --- a/addons/hr_contract/models/hr_contract.py +++ b/addons/hr_contract/models/hr_contract.py @@ -156,7 +156,7 @@ class Contract(models.Model): ]) for contract in contracts: - contract.activity_schedule( + contract.with_context(mail_activity_quick_update=True).activity_schedule( 'mail.mail_activity_data_todo', contract.date_end, _("The contract of %s is about to expire.", contract.employee_id.name), user_id=contract.hr_responsible_id.id or self.env.uid)