From e8c4ecd3d40f7407db77a958e709ff388ac7f501 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Thu, 7 Mar 2019 14:58:03 +0000 Subject: [IMP] web: disable cache in debug assets When altering a view (regular or wizard's) in code/file (rather than via the client's interface) and restarting the server view caches don't get cleared and it's necessary to reload the entire client before the changes can be seen. This is annoying, and sometimes confusing so the cache is now disable in debug assets. Task 1911601 closes odoo/odoo#31667 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/services/data_manager.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src/js/services') diff --git a/addons/web/static/src/js/services/data_manager.js b/addons/web/static/src/js/services/data_manager.js index b2f6ef1feb1..fb9a29a01de 100644 --- a/addons/web/static/src/js/services/data_manager.js +++ b/addons/web/static/src/js/services/data_manager.js @@ -1,6 +1,7 @@ odoo.define('web.DataManager', function (require) { "use strict"; +var config = require('web.config'); var core = require('web.core'); var rpc = require('web.rpc'); var utils = require('web.utils'); @@ -39,7 +40,7 @@ return core.Class.extend({ var self = this; var key = this._gen_key(action_id, additional_context || {}); - if (!this._cache.actions[key]) { + if (config.debug === 'assets' || !this._cache.actions[key]) { this._cache.actions[key] = rpc.query({ route: "/web/action/load", params: { @@ -79,7 +80,7 @@ return core.Class.extend({ var views_descr = params.views_descr; var key = this._gen_key(model, views_descr, options || {}, context); - if (!this._cache.views[key]) { + if (config.debug === 'assets' || !this._cache.views[key]) { // Don't load filters if already in cache var filters_key; if (options.load_filters) { @@ -134,7 +135,7 @@ return core.Class.extend({ */ load_filters: function (params) { var key = this._gen_key(params.modelName, params.actionId); - if (!this._cache.filters[key]) { + if (config.debug === 'assets' || !this._cache.filters[key]) { this._cache.filters[key] = rpc.query({ args: [params.modelName, params.actionId], kwargs: { -- cgit v1.2.3