Skip to content

Commit

Permalink
[FIX] mail: allow non-internal users to create chat from token
Browse files Browse the repository at this point in the history
Follow up of odoo#90415
After removing the public field, the equivalent access is to set the
allowed group to empty.

closes odoo#114675

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
  • Loading branch information
seb-odoo committed Mar 8, 2023
1 parent 9e17752 commit fcafd60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions addons/mail/controllers/discuss.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _response_discuss_channel_from_token(self, create_token, channel_name=None,
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,
})
Expand Down
6 changes: 6 additions & 0 deletions addons/mail/tests/test_mail_channel_as_guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@ def test_mail_channel_public_page_as_portal(self):

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)

0 comments on commit fcafd60

Please sign in to comment.