summaryrefslogtreecommitdiff
path: root/addons/project
diff options
context:
space:
mode:
authorKamesh Patel <kat@odoo.com>2020-10-19 05:43:00 +0000
committerYannick Tivisse <yti@odoo.com>2020-12-08 15:32:57 +0000
commit46fd7d7979f25c5fe8fe36999186a10ffb6376dc (patch)
tree2418e08cd874f375198a91741468b19fe7b1d7d2 /addons/project
parent7fbea075e5803360a798455dee16a9cdaf0bf271 (diff)
[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#63042 Taskid: 2339894 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/project')
-rw-r--r--addons/project/models/project.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py
index 0887bd49f31..e06a952323f 100644
--- a/addons/project/models/project.py
+++ b/addons/project/models/project.py
@@ -1173,7 +1173,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):