From 634dd654712b8c91f56a6c3ab97103eff3b5afbe Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 31 Jan 2020 13:11:39 +0000 Subject: [IMP] web: Reload after company creation Purpose ======= At the second res.company creation, the multicompany mode is 'enabled'. But to get the company selector dropdown, the user needs to reload the page. Specification ============= Force a reload at res.company creation, similarly to the forced reload when updating the language (lang) of the user. closes odoo/odoo#44386 Taskid: 2127257 Signed-off-by: Yannick Tivisse (yti) --- addons/web/static/src/js/views/basic/basic_model.js | 5 +++++ 1 file changed, 5 insertions(+) (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 ca4d54a16ff..1ed8c36bb98 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -3705,6 +3705,8 @@ var BasicModel = AbstractModel.extend({ * its root parent) of the given dataPoint is a model in 'noCacheModels'. * * 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. * * @private * @param {Object} dataPoint @@ -3716,6 +3718,9 @@ var BasicModel = AbstractModel.extend({ if (dataPoint.model === 'res.currency') { session.reloadCurrencies(); } + if (dataPoint.model === 'res.company') { + this.do_action('reload_context'); + } if (_.contains(this.noCacheModels, dataPoint.model)) { core.bus.trigger('clear_cache'); } -- cgit v1.2.3