From ef300d6463ed44f8b9f06536343f8cb1de42263c Mon Sep 17 00:00:00 2001 From: "Thomas Lefebvre (thle)" Date: Mon, 7 Nov 2022 13:53:45 +0000 Subject: [PATCH] [FIX] website_slides: error message on elearning course preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce: - go to eLearning app; - select a course and go to its website page; - the course may (or not) be published; - join the course; - click on a course material which is not pusblished. (the course material does not have to be completed before) (on loading slide on full-screen mode) (in debug mode, it is not a "pop-up" but an classic error) Issue: A message "Odoo Session Expired" appeard. Cause: The course is not marked as completed. The `canSelfMarkCompleted` attribut is always False and will raise the error because we will continue the flow as if the slide is completed and this is not the case. Solution: We have to test this `canSelfMarkCompleted` attribut to decide whether or not we continue. opw-3033797 closes odoo/odoo#105379 X-original-commit: 6ca729d0ada58f2d7db736ecb4fa3aa98fbc9068 Signed-off-by: Stéphane Debauche (std) Signed-off-by: Lefebvre Thomas (thle) --- addons/website_slides/static/src/js/slides_course_page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_slides/static/src/js/slides_course_page.js b/addons/website_slides/static/src/js/slides_course_page.js index 4e34bfed484..74146158f75 100644 --- a/addons/website_slides/static/src/js/slides_course_page.js +++ b/addons/website_slides/static/src/js/slides_course_page.js @@ -84,7 +84,7 @@ export const SlideCoursePage = publicWidget.Widget.extend({ * false to mark the slide as not completed */ _toggleSlideCompleted: async function (slide, completed = true) { - if (!!slide.completed === !!completed || !slide.isMember) { + if (!!slide.completed === !!completed || !slide.isMember || !slide.canSelfMarkCompleted) { // no useless RPC call return; }