summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/data_manager.js
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2016-08-23 13:49:15 +0200
committerGéry Debongnie <ged@odoo.com>2016-09-28 16:55:51 +0200
commit5b94799c820fb1d2ac530fd67f29cfd70722cb5b (patch)
treef2c3f6e38b8cb38fad5e57b0324b0eff2a9c0f6d /addons/web/static/src/js/framework/data_manager.js
parentb1b80d8d6d4ff117a1835cd7617a8e48627e6c8c (diff)
[IMP] web: allow to clear the cache in data manager
Sometimes, we need better control on the cache. For example, if a view or an action has been changed, it is required to make sure that the correct data is loaded.
Diffstat (limited to 'addons/web/static/src/js/framework/data_manager.js')
-rw-r--r--addons/web/static/src/js/framework/data_manager.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/web/static/src/js/framework/data_manager.js b/addons/web/static/src/js/framework/data_manager.js
index 29d6d585f6a..f2aa602ab41 100644
--- a/addons/web/static/src/js/framework/data_manager.js
+++ b/addons/web/static/src/js/framework/data_manager.js
@@ -9,6 +9,10 @@ var utils = require('web.utils');
return core.Class.extend({
init: function () {
this.Filters = new Model('ir.filters');
+ this._init_cache();
+ },
+
+ _init_cache: function () {
this._cache = {
actions: {},
fields_views: {},
@@ -19,6 +23,14 @@ return core.Class.extend({
},
/**
+ * Invalidates the whole cache
+ * Suggestion: could be refined to invalidate some part of the cache
+ */
+ invalidate: function () {
+ this._init_cache();
+ },
+
+ /**
* Loads an action from its id or xmlid.
*
* @param {int|string} [action_id] the action id or xmlid