[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) <yti@odoo.com>
This commit is contained in:
Leonardo Pavan Rocha
2022-03-31 15:26:48 +02:00
committed by Yannick Tivisse
parent 33867b9f5c
commit 04861eaf9e
+1 -1
View File
@@ -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)