From 99b1b081070ebf9d6f5b444938c2032b2fdec8c2 Mon Sep 17 00:00:00 2001 From: Christopher Rogos Date: Thu, 29 Aug 2024 09:49:51 +0000 Subject: [PATCH] [FIX] tracking_manager: prevent error on models without mail.thread mixin --- tracking_manager/models/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tracking_manager/models/models.py b/tracking_manager/models/models.py index 360b996f7..f70a8b8ea 100644 --- a/tracking_manager/models/models.py +++ b/tracking_manager/models/models.py @@ -85,6 +85,9 @@ class Base(models.AbstractModel): def _tm_post_message(self, data): for model_name, model_data in data.items(): + # check if record has mail.thread mixin + if not getattr(self.env[model_name], "message_post_with_source", False): + continue for record_id, messages_by_field in model_data.items(): record = self.env[model_name].browse(record_id) messages = [