diff --git a/addons/web_tour/static/src/js/public/tour_manager.js b/addons/web_tour/static/src/js/public/tour_manager.js
new file mode 100644
index 00000000000..a5b4c588833
--- /dev/null
+++ b/addons/web_tour/static/src/js/public/tour_manager.js
@@ -0,0 +1,21 @@
+odoo.define('web_tour.public.TourManager', function (require) {
+'use strict';
+
+var TourManager = require('web_tour.TourManager');
+var lazyloader = require('web.public.lazyloader');
+
+TourManager.include({
+ /**
+ * @override
+ */
+ _waitBeforeTourStart: function () {
+ return this._super.apply(this, arguments).then(function () {
+ return lazyloader.allScriptsLoaded;
+ }).then(function () {
+ return new Promise(function (resolve) {
+ setTimeout(resolve);
+ });
+ });
+ },
+});
+});
diff --git a/addons/web_tour/static/src/js/tour_manager.js b/addons/web_tour/static/src/js/tour_manager.js
index 18b2c47d6b3..fab05a7fb69 100644
--- a/addons/web_tour/static/src/js/tour_manager.js
+++ b/addons/web_tour/static/src/js/tour_manager.js
@@ -81,11 +81,32 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, {
}
this.tours[name] = tour;
},
+ /**
+ * Returns a promise which is resolved once the tour can be started. This
+ * is when the DOM is ready and at the end of the execution stack so that
+ * all tours have potentially been extended by all apps.
+ *
+ * @private
+ * @returns {Promise}
+ */
+ _waitBeforeTourStart: function () {
+ return new Promise(function (resolve) {
+ $(function () {
+ setTimeout(resolve);
+ });
+ });
+ },
_register_all: function (do_update) {
- if (this._all_registered) return;
- this._all_registered = true;
-
- _.each(this.tours, this._register.bind(this, do_update));
+ var self = this;
+ if (this._allRegistered) {
+ return Promise.resolve();
+ }
+ this._allRegistered = true;
+ return self._waitBeforeTourStart().then(function () {
+ return Promise.all(_.map(self.tours, function (tour, name) {
+ return self._register(do_update, tour, name);
+ }));
+ });
},
_register: function (do_update, tour, name) {
if (tour.ready) return Promise.resolve();
@@ -193,7 +214,6 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, {
* @returns {boolean} true if a tip was found and activated/updated
*/
_check_for_tooltip: function (tip, tour_name) {
-
if ($('body').hasClass('o_ui_blocked')) {
this._deactivate_tip(tip);
this._log.push("blockUI is preventing the tip to be consumed");
diff --git a/addons/web_tour/static/src/js/tour_service.js b/addons/web_tour/static/src/js/tour_service.js
index 92e8148a901..87cf69b7d83 100644
--- a/addons/web_tour/static/src/js/tour_service.js
+++ b/addons/web_tour/static/src/js/tour_service.js
@@ -56,29 +56,19 @@ return session.is_bound.then(function () {
}, 500);
var observer = new MutationObserver(check_tooltip);
var start_service = (function () {
-
return function (observe) {
-
- var promise = new Promise(function (resolve, reject) {
- $(function () {
- /**
- * Once the DOM is ready, we still have to wait all the modules are loaded before completing the tours
- * registration and starting listening for DOM mutations.
- */
- _.defer(function () {
- tour_manager._register_all(observe);
- if (observe) {
- observer.observe(document.body, {
- attributes: true,
- childList: true,
- subtree: true,
- });
- }
- resolve();
- });
+ return new Promise(function (resolve, reject) {
+ tour_manager._register_all(observe).then(function () {
+ if (observe) {
+ observer.observe(document.body, {
+ attributes: true,
+ childList: true,
+ subtree: true,
+ });
+ }
+ resolve();
});
});
- return promise;
};
})();
diff --git a/addons/web_tour/views/tour_templates.xml b/addons/web_tour/views/tour_templates.xml
index 6830501ceeb..816405a39d5 100644
--- a/addons/web_tour/views/tour_templates.xml
+++ b/addons/web_tour/views/tour_templates.xml
@@ -18,5 +18,11 @@
+
+
+
+
+
+
diff --git a/addons/website/static/src/js/menu/customize.js b/addons/website/static/src/js/menu/customize.js
index 00d2bef687b..4481d0f616c 100644
--- a/addons/website/static/src/js/menu/customize.js
+++ b/addons/website/static/src/js/menu/customize.js
@@ -199,8 +199,9 @@ var AceEditorMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
self.globalEditor = new WebsiteAceEditor(self, $(document.documentElement).data('view-xmlid'), {
initialResID: initialResID,
defaultBundlesRestriction: [
- "web.assets_frontend",
- "website.assets_frontend",
+ 'web.assets_frontend',
+ 'web.assets_frontend_minimal',
+ 'web.assets_frontend_lazy',
],
});
return self.globalEditor.appendTo(document.body);
diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml
index 9917615d803..8de35096b51 100644
--- a/addons/website/views/website_templates.xml
+++ b/addons/website/views/website_templates.xml
@@ -230,7 +230,7 @@
-
+