[FIX] mail_notification_custom_subject: Error modifying subtype_id

[IMP] update dotfiles [ci skip]
This commit is contained in:
Olga Marco 2022-01-24 10:32:01 +01:00 committed by Víctor Martínez
parent ddc9efe4af
commit 4b5eeec844

View File

@ -28,7 +28,6 @@ class MailThread(models.AbstractModel):
record_name=False, record_name=False,
**kwargs **kwargs
): ):
subtype_id = kwargs.get("subtype_id", False)
if not subtype_id and subtype_xmlid: if not subtype_id and subtype_xmlid:
subtype_id = self.env["ir.model.data"].xmlid_to_res_id( subtype_id = self.env["ir.model.data"].xmlid_to_res_id(
subtype_xmlid, subtype_xmlid,
@ -39,15 +38,10 @@ class MailThread(models.AbstractModel):
[("model_id.model", "=", self._name), ("subtype_ids", "=", subtype_id)] [("model_id.model", "=", self._name), ("subtype_ids", "=", subtype_id)]
) )
if not subject: if not subject:
subject = ( subject = "Re: %s" % self.env["mail.message"].with_context(
"Re: %s"
% self.env["mail.message"]
.with_context(
default_model=self._name, default_model=self._name,
default_res_id=self.id, default_res_id=self.id,
) )._get_record_name({})
._get_record_name({})
)
for template in custom_subjects: for template in custom_subjects:
try: try:
rendered_subject_template = self.env[ rendered_subject_template = self.env[