From 71cdae1c1283147b6679d544a0dd1d4a234b4ce9 Mon Sep 17 00:00:00 2001 From: Pallavi Savaliya Date: Fri, 5 Aug 2022 05:49:13 +0000 Subject: [PATCH] [FIX] sale_project: fix the chatter message on fsm product addition Before this commit, A 'task created' notification is generated each time the user adds a product from the FSM task even when the new task is not generated as it's directly linked with particular fsm task. So in this commit, check if SOL is linked with the task and if linked then do not log a message on order chatter. task-2926348 closes odoo/odoo#103130 X-original-commit: cdf70448b1776b010b6a17f46eb17c7131e6c4b3 Signed-off-by: Laurent Stukkens (ltu) --- addons/sale_project/models/sale_order_line.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale_project/models/sale_order_line.py b/addons/sale_project/models/sale_order_line.py index 78a84741ae6..092c8ece05c 100644 --- a/addons/sale_project/models/sale_order_line.py +++ b/addons/sale_project/models/sale_order_line.py @@ -106,9 +106,10 @@ class SaleOrderLine(models.Model): # generate task with hours=0. for line in lines: if line.state == 'sale' and not line.is_expense: + has_task = bool(line.task_id) line.sudo()._timesheet_service_generation() # if the SO line created a task, post a message on the order - if line.task_id: + if line.task_id and not has_task: msg_body = _("Task Created (%s): %s", line.product_id.name, line.task_id._get_html_link()) line.order_id.message_post(body=msg_body) return lines