[FIX] website_slides: lessen concurrent update by waiting slide completion

PURPOSE

Test frontend and UI tools of eLearning.

SPECIFICATIONS

When switching through slides using the fullscreen player it is quite
common to have concurrent updates on slide.slide.partner model as it is
used to store the viewed and completed. By correctly waiting for the
completion to be done we lessen potential concurrent errors.

LINKS

Task ID 1937768
This commit is contained in:
Thibault Delavallée
2019-08-28 13:27:58 +00:00
parent 9b12a8b9d7
commit 608ea7f85d
@@ -444,7 +444,7 @@ odoo.define('website_slides.fullscreen', function (require) {
this._toggleSidebar();
}
return this._super.apply(this, arguments).then(function () {
self._onChangeSlide(); // trigger manually once DOM ready, since slide content is not rendered server side
return self._onChangeSlide(); // trigger manually once DOM ready, since slide content is not rendered server side
});
},
/**
@@ -595,6 +595,7 @@ odoo.define('website_slides.fullscreen', function (require) {
}
}).then(function (data){
self._markAsCompleted(slideId, data.channel_completion);
return Promise.resolve();
});
}
return Promise.resolve();
@@ -620,7 +621,7 @@ odoo.define('website_slides.fullscreen', function (require) {
return self._renderSlide();
}).then(function() {
if (slide._autoSetDone && !session.is_website_user) { // no useless RPC call
self._setCompleted(slide.id);
return self._setCompleted(slide.id);
}
});
},