summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/services
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/services')
-rw-r--r--addons/web/static/src/js/services/core.js2
-rw-r--r--addons/web/static/src/js/services/data_manager.js23
2 files changed, 14 insertions, 11 deletions
diff --git a/addons/web/static/src/js/services/core.js b/addons/web/static/src/js/services/core.js
index 522d6b07302..3d6cfc4e684 100644
--- a/addons/web/static/src/js/services/core.js
+++ b/addons/web/static/src/js/services/core.js
@@ -39,8 +39,6 @@ return {
// registries
action_registry : new Registry(),
crash_registry: new Registry(),
- search_filters_registry: new Registry(),
- search_widgets_registry: new Registry(),
serviceRegistry: new Registry(),
/**
* @type {String}
diff --git a/addons/web/static/src/js/services/data_manager.js b/addons/web/static/src/js/services/data_manager.js
index bb7f25d206b..afedaa1148f 100644
--- a/addons/web/static/src/js/services/data_manager.js
+++ b/addons/web/static/src/js/services/data_manager.js
@@ -128,15 +128,20 @@ return core.Class.extend({
*
* @param {Object} [dataset] the dataset for which the filters are loaded
* @param {int} [action_id] the id of the action (optional)
+ * @param {Object} params
+ * @param {string} params.modelName
+ * @param {Object} params.context
+ * @param {integer} params.actionId
* @return {Deferred} resolved with the requested filters
*/
- load_filters: function (dataset, action_id) {
- var key = this._gen_key(dataset.model, action_id);
+ load_filters: function (params) {
+ var key = this._gen_key(params.modelName, params.actionId);
if (!this._cache.filters[key]) {
this._cache.filters[key] = rpc.query({
- args: [dataset.model, action_id],
+ args: [params.modelName, params.actionId],
kwargs: {
- context: dataset.get_context(),
+ context: params.context || {},
+ // get_context() de dataset
},
model: 'ir.filters',
method: 'get_filters',
@@ -158,26 +163,26 @@ return core.Class.extend({
model: 'ir.filters',
method: 'create_or_replace',
})
- .then(function (filter_id) {
+ .then(function (filterId) {
var key = [
filter.model_id,
filter.action_id || false,
].join(',');
self._invalidate(self._cache.filters, key);
- return filter_id;
+ return filterId;
});
},
/**
* Calls 'unlink' on 'ir_filters'.
*
- * @param {Object} [filter] the description of the filter to remove
+ * @param {integer} filterId, Id of the filter to remove
* @return {Deferred}
*/
- delete_filter: function (filter) {
+ delete_filter: function (filterId) {
var self = this;
return rpc.query({
- args: [filter.id],
+ args: [filterId],
model: 'ir.filters',
method: 'unlink',
})