From 67e2372d6164b57fb0283033b0d3a4963a8314f1 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 24 Jul 2017 16:13:47 +0200 Subject: [PATCH] [IMP] web_tour, *: allow to extend timeout limit for specific steps * website Unfortunately, we cannot guarantee that the duration between two odoo actions is always less than 10 seconds. Indeed, loading translations is for example quite slow. With this commit, we are now able to modify the timeout duration for a specific step. --- addons/web_tour/static/src/js/tour_manager.js | 2 +- addons/website/static/src/js/website.tour.rte.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web_tour/static/src/js/tour_manager.js b/addons/web_tour/static/src/js/tour_manager.js index 1999b6f6f0c..b0f3804ee82 100644 --- a/addons/web_tour/static/src/js/tour_manager.js +++ b/addons/web_tour/static/src/js/tour_manager.js @@ -447,7 +447,7 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, { this._stop_running_tour_timeout(); this.running_tour_timeout = setTimeout((function() { this._consume_tour(tour_name, _.str.sprintf("Tour %s failed at step %s", tour_name, step.trigger)); - }).bind(this), RUNNING_TOUR_TIMEOUT + this.running_step_delay); + }).bind(this), (step.timeout || RUNNING_TOUR_TIMEOUT) + this.running_step_delay); }, _stop_running_tour_timeout: function () { clearTimeout(this.running_tour_timeout); diff --git a/addons/website/static/src/js/website.tour.rte.js b/addons/website/static/src/js/website.tour.rte.js index 7785441faa0..d428c46fa7f 100644 --- a/addons/website/static/src/js/website.tour.rte.js +++ b/addons/website/static/src/js/website.tour.rte.js @@ -24,6 +24,7 @@ tour.register('rte_translator', { content: "go to english version", trigger: '.js_language_selector a[data-lang="en_US"]', extra_trigger: 'html[lang*="fr"]', + timeout: 60000, }, { content: "Open new page menu", trigger: '#oe_main_menu_navbar a[data-action=new_page]',