diff --git a/mail_notification_custom_subject/models/mail_thread.py b/mail_notification_custom_subject/models/mail_thread.py index bc9c33b..8b97a63 100644 --- a/mail_notification_custom_subject/models/mail_thread.py +++ b/mail_notification_custom_subject/models/mail_thread.py @@ -1,5 +1,6 @@ # Copyright 2020-2021 Tecnativa - João Marques # Copyright 2021 Tecnativa - Pedro M. Baeza +# Copyright 2022 Moduon - Eduardo de Miguel # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, models @@ -27,11 +28,13 @@ class MailThread(models.AbstractModel): record_name=False, **kwargs ): - if not subtype_id and subtype_xmlid: + if subtype_xmlid: subtype_id = self.env["ir.model.data"]._xmlid_to_res_id( subtype_xmlid, raise_if_not_found=False, ) + if not subtype_id: + subtype_id = self.env["ir.model.data"]._xmlid_to_res_id("mail.mt_note") if subtype_id: custom_subjects = ( self.env["mail.message.custom.subject"] diff --git a/mail_notification_custom_subject/readme/CONTRIBUTORS.rst b/mail_notification_custom_subject/readme/CONTRIBUTORS.rst index 82fac20..f88a42e 100644 --- a/mail_notification_custom_subject/readme/CONTRIBUTORS.rst +++ b/mail_notification_custom_subject/readme/CONTRIBUTORS.rst @@ -7,3 +7,6 @@ * Versada * Naglis Jonaitis + +* Moduon + * Eduardo de Miguel