summaryrefslogtreecommitdiff
path: root/addons/web_tour/static/src/js/debug_manager.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-07-29 17:55:21 +0200
committerChristophe Simonis <chs@odoo.com>2016-07-29 17:55:21 +0200
commit523d3af131a48e527012d93d17e74b496b93085d (patch)
treec14274da7f7caf836c5d200a5bb253f6d95f4521 /addons/web_tour/static/src/js/debug_manager.js
parent6a4899ea8f53a2dd355b49ee1c1fb475235a3d79 (diff)
parent16d65a8493187a4524f53b57650495fbbe529cbd (diff)
[MERGE] forward port branch saas-12 up to 16d65a8
Diffstat (limited to 'addons/web_tour/static/src/js/debug_manager.js')
-rw-r--r--addons/web_tour/static/src/js/debug_manager.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/addons/web_tour/static/src/js/debug_manager.js b/addons/web_tour/static/src/js/debug_manager.js
new file mode 100644
index 00000000000..3e23207462c
--- /dev/null
+++ b/addons/web_tour/static/src/js/debug_manager.js
@@ -0,0 +1,28 @@
+odoo.define('web_tour.DebugManager', function (require) {
+"use strict";
+
+var DebugManager = require('web.DebugManager');
+var Model = require('web.Model');
+
+var tour = require('web_tour.tour');
+
+function get_active_tours () {
+ return _.difference(_.keys(tour.tours), tour.consumed_tours);
+}
+
+DebugManager.include({
+ start: function () {
+ this.consume_tours_enabled = get_active_tours().length > 0;
+ return this._super.apply(this, arguments);
+ },
+ consume_tours: function () {
+ var active_tours = get_active_tours();
+ if (active_tours.length > 0) { // tours might have been consumed meanwhile
+ new Model('web_tour.tour').call('consume', [active_tours]).then(function () {
+ window.location.reload();
+ });
+ }
+ },
+});
+
+});