summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2019-03-07 14:58:03 +0000
committerMartin Geubelle <mge@odoo.com>2019-03-07 15:02:37 +0000
commite8c4ecd3d40f7407db77a958e709ff388ac7f501 (patch)
tree9a2f2f8aefdf3f8546031b631a76c3c8fcad7466 /addons
parent5dc971b1ae15a9f9e6e92914a3b0d98159c9a38f (diff)
[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) <aab@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/src/js/services/data_manager.js7
1 files changed, 4 insertions, 3 deletions
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: {