summaryrefslogtreecommitdiff
path: root/addons/mail/controllers/main.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2019-06-17 09:45:09 +0000
committerRaphael Collet <rco@odoo.com>2019-07-04 11:32:22 +0000
commitb7fd679a6c41dbb694c6fb2ce4911798de0424b1 (patch)
treecb4e75910deb2516d5397925e96ab5e680eed9e1 /addons/mail/controllers/main.py
parent1e6c3bec2c5ca621344b09e58dbed535e80fb343 (diff)
[FIX] *: sudo() -> with_user()
Diffstat (limited to 'addons/mail/controllers/main.py')
-rw-r--r--addons/mail/controllers/main.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py
index 3cd19d1bc8c..38c4cbb3509 100644
--- a/addons/mail/controllers/main.py
+++ b/addons/mail/controllers/main.py
@@ -68,7 +68,7 @@ class MailController(http.Controller):
# the record has a window redirection: check access rights
if uid is not None:
- if not RecordModel.sudo(uid).check_access_rights('read', raise_exception=False):
+ if not RecordModel.with_user(uid).check_access_rights('read', raise_exception=False):
return cls._redirect_to_messaging()
try:
# We need here to extend the "allowed_company_ids" to allow a redirection
@@ -77,7 +77,7 @@ class MailController(http.Controller):
cids = request.httprequest.cookies.get('cids', str(user.company_id.id))
cids = [int(cid) for cid in cids.split(',')]
try:
- record_sudo.sudo(uid).with_context(allowed_company_ids=cids).check_access_rule('read')
+ record_sudo.with_user(uid).with_context(allowed_company_ids=cids).check_access_rule('read')
except AccessError:
# In case the allowed_company_ids from the cookies (i.e. the last user configuration
# on his browser) is not sufficient to avoid an ir.rule access error, try to following
@@ -92,7 +92,7 @@ class MailController(http.Controller):
if not suggested_company:
raise AccessError()
cids += [suggested_company.id]
- record_sudo.sudo(uid).with_context(allowed_company_ids=cids).check_access_rule('read')
+ record_sudo.with_user(uid).with_context(allowed_company_ids=cids).check_access_rule('read')
except AccessError:
return cls._redirect_to_messaging()
else: