From 92579b312df11fbf4f373b3b74dc32187197a6b4 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Thu, 3 Oct 2024 21:52:08 -0400 Subject: [PATCH] [FIX] project_task_attachements: create only modify attach_to task --- project_task_attachments/models/ir_attachment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project_task_attachments/models/ir_attachment.py b/project_task_attachments/models/ir_attachment.py index 0999b29815..fe5cc738b6 100644 --- a/project_task_attachments/models/ir_attachment.py +++ b/project_task_attachments/models/ir_attachment.py @@ -53,7 +53,8 @@ def create(self, vals_list): 'project.project'): vals['project_id'] = vals['res_id'] vals['attach_to'] = 'project' - else: + elif ('task_id' not in vals.keys() and vals['res_model'] == + 'project.task'): vals['task_id'] = vals['res_id'] vals['attach_to'] = 'task' return super().create(vals_list)