[FIX] mail: allow non-internal users to create chat from token

Follow up of https://github.com/odoo/odoo/pull/90415
After removing the public field, the equivalent access is to set the
allowed group to empty.

closes odoo/odoo#114729

X-original-commit: fcafd602dda4f896ac8b91c81c00ee723afd6634
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Sébastien Theys
2023-03-09 12:00:56 +01:00
parent ef4b80c408
commit 94845bb63f
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -56,6 +56,7 @@ class DiscussController(http.Controller):
channel_sudo = channel_sudo.create({
'channel_type': 'channel',
'default_display_mode': default_display_mode,
'group_public_id': None,
'name': channel_name or create_token,
'uuid': create_token,
})
@@ -77,3 +77,9 @@ class TestMailPublicPage(HttpCase):
def test_mail_group_public_page_as_portal(self):
self._open_group_page_as_user('portal')
def test_chat_from_token_as_guest(self):
self.env['ir.config_parameter'].set_param('mail.chat_from_token', True)
self.url_open('/chat/xyz')
channel = self.env['mail.channel'].search([('uuid', '=', 'xyz')])
self.assertEqual(len(channel), 1)