From f7c0480dc15a00045a8d40ee545a53aeeb13605e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 8 Dec 2015 17:14:58 +0100 Subject: [PATCH] [FIX] mail: fix 504227cca92f0743c10a2f13ef03c55f936d2105 Do not restrict followers-based alias to members of non public channels. Otherwise you may have issues defining a public mailing list with a subscription step. People still wouldn't be able to post on a public channel using a restricted alias. --- addons/mail/i18n/mail.pot | 2 +- addons/mail/models/mail_alias.py | 2 +- addons/mail/models/mail_thread.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mail/i18n/mail.pot b/addons/mail/i18n/mail.pot index a2f6a8a923c..3b802987106 100644 --- a/addons/mail/i18n/mail.pot +++ b/addons/mail/i18n/mail.pot @@ -2219,7 +2219,7 @@ msgstr "" msgid "Policy to post a message on the document using the mailgateway.\n" "- everyone: everyone can post\n" "- partners: only authenticated partners\n" -"- followers: only followers of the related document or members of following channels that are not public\n" +"- followers: only followers of the related document or members of following channels\n" "" msgstr "" diff --git a/addons/mail/models/mail_alias.py b/addons/mail/models/mail_alias.py index 0c251fec93a..ba1afd02d45 100644 --- a/addons/mail/models/mail_alias.py +++ b/addons/mail/models/mail_alias.py @@ -78,7 +78,7 @@ class Alias(models.Model): help="Policy to post a message on the document using the mailgateway.\n" "- everyone: everyone can post\n" "- partners: only authenticated partners\n" - "- followers: only followers of the related document or members of following channels that are not public\n") + "- followers: only followers of the related document or members of following channels\n") _sql_constraints = [ ('alias_unique', 'UNIQUE(alias_name)', 'Unfortunately this email alias is already used, please choose a unique one') diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 81a335e4dee..f97978b47b0 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -870,7 +870,7 @@ class MailThread(models.AbstractModel): obj = self.env[alias.alias_parent_model_id.model].browse(alias.alias_parent_thread_id) accepted_partner_ids = list( set(partner.id for partner in obj.message_partner_ids) | - set(partner.id for channel in obj.message_channel_ids if channel.public != 'public' for partner in channel.channel_partner_ids) + set(partner.id for channel in obj.message_channel_ids for partner in channel.channel_partner_ids) ) if not author_id or author_id not in accepted_partner_ids: _warn('alias %s restricted to internal followers, skipping' % alias.alias_name)