From ee89ccbbaa7422864f73e07834dd96a3b3f6c310 Mon Sep 17 00:00:00 2001 From: Eduardo De Miguel Date: Wed, 20 Apr 2022 13:24:43 +0200 Subject: [PATCH] [FIX] Avoid CacheMiss errors Avoid CacheMiss errors setting a value on message_content field. --- base_search_mail_content/models/mail_thread.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base_search_mail_content/models/mail_thread.py b/base_search_mail_content/models/mail_thread.py index 4857391..f62e1c5 100644 --- a/base_search_mail_content/models/mail_thread.py +++ b/base_search_mail_content/models/mail_thread.py @@ -29,10 +29,14 @@ class MailThread(models.AbstractModel): message_content = fields.Text( help="Message content, to be used only in searches", - compute=lambda self: False, + compute="_compute_message_content", search="_search_message_content", ) + def _compute_message_content(self): + # Always assign a value to avoid CacheMiss errors + self.message_content = False + @api.model def fields_view_get( self, view_id=None, view_type="form", toolbar=False, submenu=False