From 74597262f61cd625a682856b699ab39aa174e50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valent=C3=ADn=20Georgian=20Castravete?= Date: Wed, 3 Jul 2024 14:38:35 +0200 Subject: [PATCH] [FIX] Publish customer messages on website --- mail_private_no_published/models/mail_message.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mail_private_no_published/models/mail_message.py b/mail_private_no_published/models/mail_message.py index 4739072..786b94e 100644 --- a/mail_private_no_published/models/mail_message.py +++ b/mail_private_no_published/models/mail_message.py @@ -50,5 +50,14 @@ def create(self, vals): customer_users = user_ids.filtered(lambda user: user.has_group('base.group_portal')) if customer_users or (partner_ids and not user_ids): continue + + author_id = rec.author_id + user = self.env['res.users'].search([ + ('partner_id', '=', author_id.id), + ('active', 'in', [True, False]), + ]) + if not user or (user and not user.has_group('base.group_user')): + continue + rec.website_published = False return res