Skip to content
Snippets Groups Projects
Commit 5130765d authored by Aurélien Warnon's avatar Aurélien Warnon
Browse files

[FIX] website_slides: allow portal users to share slides by email


Sharing content by email as portal is not working and raises an AccessRecord
because we are trying to access the "email_formatted" field of the company.

This is solved by adding 'compute_sudo' to the computed field.

Indeed, we want portal users to be able to read the email address of the
company while they cannot access res.partner records.

A tour has been adapted to ensure this behavior.

Task-3349132

closes odoo/odoo#123647

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent caf6183c
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,10 @@ class Company(models.Model):
catchall_email = fields.Char(string="Catchall Email", compute="_compute_catchall")
catchall_formatted = fields.Char(string="Catchall", compute="_compute_catchall")
email_formatted = fields.Char(string="Formatted Email", compute="_compute_email_formatted")
# the compute method is sudo'ed because it needs to access res.partner records
# portal users cannot access those (but they should be able to read the company email address)
email_formatted = fields.Char(string="Formatted Email",
compute="_compute_email_formatted", compute_sudo=True)
@api.depends('name')
def _compute_catchall(self):
......
......@@ -30,7 +30,23 @@ tour.register('course_member', {
// eLearning: follow course by cliking on first lesson and going to fullscreen player
{
trigger: '.o_wslides_fs_sidebar_list_item div:contains("Home Gardening")'
},
// eLearning: share the first slide
{
trigger: '.o_wslides_fs_share'
}, {
trigger: '.o_wslides_js_share_email input[type="email"]',
run: 'text friend@example.com'
}, {
trigger: '.o_wslides_js_share_email button',
}, {
trigger: '.o_wslides_js_share_email:contains("Thank you")',
run: function () {} // check email has been sent
}, {
trigger: '.modal-footer button:contains("Cancel")',
},
// eLeaning: course completion
{
trigger: '.o_wslides_fs_sidebar_header',
run: function () {
// check navigation with arrow keys
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment