[FIX] tracking_manager: prevent error on models without mail.thread mixin

pull/3023/head
Christopher Rogos 2024-08-29 09:49:51 +00:00
parent 808ad8944c
commit 99b1b08107
1 changed files with 3 additions and 0 deletions

View File

@ -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 = [