From 4b5eeec844eb664235139efc7f25e6e95f4d647f Mon Sep 17 00:00:00 2001 From: Olga Marco Date: Mon, 24 Jan 2022 10:32:01 +0100 Subject: [PATCH] [FIX] mail_notification_custom_subject: Error modifying subtype_id [IMP] update dotfiles [ci skip] --- .../models/mail_thread.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/mail_notification_custom_subject/models/mail_thread.py b/mail_notification_custom_subject/models/mail_thread.py index 6c97088..17d8042 100644 --- a/mail_notification_custom_subject/models/mail_thread.py +++ b/mail_notification_custom_subject/models/mail_thread.py @@ -28,7 +28,6 @@ class MailThread(models.AbstractModel): record_name=False, **kwargs ): - subtype_id = kwargs.get("subtype_id", False) if not subtype_id and subtype_xmlid: subtype_id = self.env["ir.model.data"].xmlid_to_res_id( subtype_xmlid, @@ -39,15 +38,10 @@ class MailThread(models.AbstractModel): [("model_id.model", "=", self._name), ("subtype_ids", "=", subtype_id)] ) if not subject: - subject = ( - "Re: %s" - % self.env["mail.message"] - .with_context( - default_model=self._name, - default_res_id=self.id, - ) - ._get_record_name({}) - ) + subject = "Re: %s" % self.env["mail.message"].with_context( + default_model=self._name, + default_res_id=self.id, + )._get_record_name({}) for template in custom_subjects: try: rendered_subject_template = self.env[