From af4e485e2960c92fa9dc7211ed847fd6a66c1489 Mon Sep 17 00:00:00 2001 From: len Date: Thu, 12 Dec 2024 11:20:35 +0100 Subject: [PATCH] [FIX] base_substate: migrate track_template function Note that because inheritance was poorly implemented in inheriting modules (such as sale_substate) this function was never called, hiding the bug. auto_delete_message was removed in odoo@9140ce06 --- base_substate/models/base_substate_mixin.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/base_substate/models/base_substate_mixin.py b/base_substate/models/base_substate_mixin.py index e3b98c0415..3789c68675 100644 --- a/base_substate/models/base_substate_mixin.py +++ b/base_substate/models/base_substate_mixin.py @@ -28,19 +28,19 @@ def check_substate_id_value(self): } ) - def _track_template(self, tracking): - res = super()._track_template(tracking) - first_rec = self[0] - changes, tracking_value_ids = tracking[first_rec.id] - if "substate_id" in changes and first_rec.substate_id.mail_template_id: + def _track_template(self, changes): + res = super()._track_template(changes) + track = self[0] + if "substate_id" in changes and track.substate_id.mail_template_id: res["substate_id"] = ( - first_rec.substate_id.mail_template_id, + track.substate_id.mail_template_id, { - "auto_delete_message": True, - "subtype_id": self.env["ir.model.data"].xmlid_to_res_id( + "composition_mode": "comment", + "auto_delete": True, + "subtype_id": self.env["ir.model.data"]._xmlid_to_res_id( "mail.mt_note" ), - "notif_layout": "mail.mail_notification_light", + "email_layout_xmlid": "mail.mail_notification_light", }, ) return res