From 9a18bb89fe131113bfcb28b3f1bcbf83f58ee68a Mon Sep 17 00:00:00 2001 From: Kamesh Patel Date: Mon, 19 Oct 2020 05:43:00 +0000 Subject: [PATCH] [FIX] project: Fix wrong recipient display based on email_from Currently, The customer that is not selected anymore is suggested as a recipient steps to reproduce: 1. create a project task without a customer set 2. select a customer, then remove it, then save 3. send a message in the chatter --> the customer that is not selected anymore is still suggested as a recipient. The issue is due to invalid value of partner's email in the field email_from on task. So in this commit, when the customer is not defined or is not a child task then keep the email_From of the task. (Here we are checking the task.parent_id because when someone update the email_from on parent it should be updated in child task's email_from and when we remove the email_From in parent it should not be removed from child task) closes odoo/odoo#63055 Taskid: 2339894 X-original-commit: 46fd7d7979f25c5fe8fe36999186a10ffb6376dc Signed-off-by: Yannick Tivisse (yti) --- addons/project/models/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index a68e98986c0..1fc6131ee0c 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -1172,7 +1172,7 @@ class Task(models.Model): @api.depends('partner_id.email', 'parent_id.email_from') def _compute_email_from(self): for task in self: - task.email_from = task.partner_id.email or task.email_from or task.parent_id.email_from + task.email_from = task.partner_id.email or ((task.partner_id or task.parent_id) and task.email_from) or task.parent_id.email_from @api.depends('parent_id.project_id.subtask_project_id') def _compute_project_id(self):