Files
odoo_source/addons/mail/tests/test_res_users.py
T
std-odooandnounoubensebia cd8e0e9f46 [IMP] base, *: hide non-relevant fields for portal users
Purpose
=======
Hide non-relevant fields for a portal user. E.G. we want to hide the
notification type,  the menu customization... Because those fields
make no sense for a portal user.

Force the non-internal user to receive notifications by emails since
they can not open Discuss.

Task-2508521

Part-of: odoo/odoo#77766
Co-authored-by: nounoubensebia <neb@odoo.com>
2021-11-09 14:45:49 +00:00

23 lines
769 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from psycopg2 import IntegrityError
from odoo.addons.mail.tests.common import MailCommon, mail_new_test_user
from odoo.tools import mute_logger
class TestUser(MailCommon):
@mute_logger('odoo.sql_db')
def test_notification_type_constraint(self):
with self.assertRaises(IntegrityError, msg='Portal user can not receive notification in Odoo'):
mail_new_test_user(
self.env,
login='user_test_constraint_2',
name='Test User 2',
email='user_test_constraint_2@test.example.com',
notification_type='inbox',
groups='base.group_portal',
)