From b35d103cc0fe64547c3212ef01ab329faf0bacc4 Mon Sep 17 00:00:00 2001 From: svs-odoo Date: Tue, 2 Oct 2018 06:54:24 +0000 Subject: [IMP] web: reload currencies when activating one Active currencies are given in session_info, in the page source. When the user activated a new currency, he had to reload the page to make the browser aware of that new currency (without reloading, there was no currency symbol displayed next to the amounts). This rev. forces a reload of the currencies each time a currency is edited. Task #1838654 closes odoo/odoo#31192 --- 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 3e20035734d..4d86ef4293b 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -3477,6 +3477,8 @@ var BasicModel = AbstractModel.extend({ * Invalidates the DataManager's cache if the main model (i.e. the model of * its root parent) of the given dataPoint is a model in 'noCacheModels'. * + * Reloads the currencies if the main model is 'res.currency'. + * * @private * @param {Object} dataPoint */ @@ -3484,6 +3486,9 @@ var BasicModel = AbstractModel.extend({ while (dataPoint.parentID) { dataPoint = this.localData[dataPoint.parentID]; } + if (dataPoint.model === 'res.currency') { + session.reloadCurrencies(); + } if (_.contains(this.noCacheModels, dataPoint.model)) { core.bus.trigger('clear_cache'); } -- cgit v1.2.3