diff options
| author | Yannick Tivisse <yti@odoo.com> | 2020-01-31 13:11:39 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-02-03 13:38:06 +0000 |
| commit | 634dd654712b8c91f56a6c3ab97103eff3b5afbe (patch) | |
| tree | 7e228ba1198f9fc8f7e1c438ebd6ae44442ffcc2 /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | 86c95be9a0541091e1044b6c37b9a9436d02f6dc (diff) | |
[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) <yti@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 5 |
1 files changed, 5 insertions, 0 deletions
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'); } |
