Files
odoo_source/addons/test_mail/tests/test_ui.py
T
Didier (did) 7ebde25cf7 [FIX] mail: avoid exception when creating channel
When a user without an email partner try to create a channel, an exception is
raised because he has no email.
This exception should not happen when creating a new channel.

task-2641660

closes odoo/odoo#77147

X-original-commit: 0970d8767ac27f9542bb3ad40a6f213f80f408d8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-24 14:00:30 +00:00

22 lines
738 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo import Command
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_mail_tour(self):
self.start_tour("/web", 'mail_tour', login="admin")
def test_02_mail_create_channel_no_mail_tour(self):
self.env['res.users'].create({
'email': '', # User should be able to create a channel even if no email is defined
'groups_id': [Command.set([self.ref('base.group_user')])],
'name': 'Test User',
'login': 'testuser',
'password': 'testuser',
})
self.start_tour("/web", 'mail_tour', login='testuser')