From 513c6d18dfbabf6bf0dc930b457f34ff94b71cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 28 Apr 2020 08:37:23 +0000 Subject: [PATCH] [FIX] website_slides: allow portal users to udpate their review Followup of 86c80d341846894c435b1c8f61ef946b06e72ec7 : currently portal users face an access issue if they change attachments in their review. This commit fixes that by sudo-ing access to the attachment as other access is already granted. Task ID 2214795 closes odoo/odoo#50815 X-original-commit: 90152abef30e043d36f8a8aabfe18c46e807973f Signed-off-by: Thibault Delavallee (tde) --- addons/website_slides/controllers/mail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_slides/controllers/mail.py b/addons/website_slides/controllers/mail.py index 30d7c911358..bad841f9795 100644 --- a/addons/website_slides/controllers/mail.py +++ b/addons/website_slides/controllers/mail.py @@ -29,7 +29,7 @@ class SlidesPortalChatter(PortalChatter): '/mail/chatter_update', ], type='http', auth="user") def mail_update_message(self, res_model, res_id, message, message_id, redirect=None, attachment_ids='', attachment_tokens='', **post): - # keep this mecanism intern to slide currently (saas 12.5) as it is + # keep this mechanism intern to slide currently (saas 12.5) as it is # considered experimental if res_model != 'slide.channel': raise Forbidden() @@ -57,7 +57,7 @@ class SlidesPortalChatter(PortalChatter): message = request.env['mail.message'].search(domain, limit=1) if not message: raise NotFound() - message.write({ + message.sudo().write({ 'body': message_body, 'attachment_ids': [(4, aid) for aid in attachment_ids], })