From e9230a1e945cac0fab986005f714c878af90be63 Mon Sep 17 00:00:00 2001 From: "Laurent Stukkens (LTU)" Date: Fri, 24 Apr 2020 13:38:17 +0000 Subject: [FIX] web: Prevent page reload during sale tour test * A step has been added to the sale tour in order to ask the user to update the company data. As a page reload breaks the tour test we need to prevent it in such situation. TaskID :2187222 closes odoo/odoo#46167 Signed-off-by: Yannick Tivisse (yti) --- addons/web/static/src/js/views/basic/basic_model.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 8de831ee506..9771fcc63e9 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -91,6 +91,7 @@ var Domain = require('web.Domain'); var session = require('web.session'); var utils = require('web.utils'); var viewUtils = require('web.viewUtils'); +var localStorage = require('web.local_storage'); var _t = core._t; @@ -3762,7 +3763,7 @@ var BasicModel = AbstractModel.extend({ * * Reloads the currencies if the main model is 'res.currency'. * Reloads the webclient if we modify a res.company, to (un)activate the - * multi-company environment. + * multi-company environment if we are not in a tour test. * * @private * @param {Object} dataPoint @@ -3774,7 +3775,7 @@ var BasicModel = AbstractModel.extend({ if (dataPoint.model === 'res.currency') { session.reloadCurrencies(); } - if (dataPoint.model === 'res.company') { + if (dataPoint.model === 'res.company' && !localStorage.getItem('running_tour')) { this.do_action('reload_context'); } if (_.contains(this.noCacheModels, dataPoint.model)) { -- cgit v1.2.3