[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user