From f563290cba5d5c2db0365e26f74bcc70d573e19a Mon Sep 17 00:00:00 2001 From: Valentin Castravete Date: Tue, 28 Nov 2023 09:13:03 +0100 Subject: [PATCH] [FIX] With context on return create --- .../models/project_project.py | 5 ++++- project_task_disable_auto_subscribe/models/project_task.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/project_task_disable_auto_subscribe/models/project_project.py b/project_task_disable_auto_subscribe/models/project_project.py index 0391863..49b2096 100644 --- a/project_task_disable_auto_subscribe/models/project_project.py +++ b/project_task_disable_auto_subscribe/models/project_project.py @@ -11,4 +11,7 @@ def create(self, vals): user_id = self.env['res.users'].browse(self._context['uid']) if not user_id.project_disable_auto_subscribe: return super().create(vals) - return super().with_context(mail_create_nosubscribe=True).create(vals) + return super( + Project, + self.with_context(mail_create_nosubscribe=True) + ).create(vals) diff --git a/project_task_disable_auto_subscribe/models/project_task.py b/project_task_disable_auto_subscribe/models/project_task.py index 53bd0e2..07a58c8 100644 --- a/project_task_disable_auto_subscribe/models/project_task.py +++ b/project_task_disable_auto_subscribe/models/project_task.py @@ -11,4 +11,7 @@ def create(self, vals): user_id = self.env['res.users'].browse(self._context['uid']) if not user_id.project_task_disable_auto_subscribe: return super().create(vals) - return super().with_context(mail_create_nosubscribe=True).create(vals) + return super( + ProjectTask, + self.with_context(mail_create_nosubscribe=True) + ).create(vals)