summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/widgets/domain_selector.js5
-rw-r--r--addons/web/static/src/js/widgets/domain_selector_dialog.js1
-rw-r--r--addons/web/static/src/js/widgets/model_field_selector.js9
3 files changed, 8 insertions, 7 deletions
diff --git a/addons/web/static/src/js/widgets/domain_selector.js b/addons/web/static/src/js/widgets/domain_selector.js
index 8ae15325d34..90c13595208 100644
--- a/addons/web/static/src/js/widgets/domain_selector.js
+++ b/addons/web/static/src/js/widgets/domain_selector.js
@@ -58,19 +58,18 @@ var DomainNode = Widget.extend({
/// @param domain - an array of the prefix representation of the domain (or a string which represents it)
/// @param options - an object with possible values:
/// - readonly, a boolean to indicate if the widget is readonly or not (default to true)
- /// - fs_filters, an object with a series of filters to use for the field selector (see @FieldSelector)
+ /// - debugMode, a boolean which is true if the widget should be in debug mode (default to false)
+ /// - @see ModelFieldSelector for other options
init: function (parent, model, domain, options) {
this._super.apply(this, arguments);
this.model = model;
this.options = _.extend({
readonly: true,
- fs_filters: {},
debugMode: false,
}, options || {});
this.readonly = this.options.readonly;
- this.fs_filters = this.options.fs_filters;
this.debug = this.options.debugMode;
},
/// The getDomain method is an abstract method which should returns the prefix domain
diff --git a/addons/web/static/src/js/widgets/domain_selector_dialog.js b/addons/web/static/src/js/widgets/domain_selector_dialog.js
index 47bfa4e1359..c8f48d0ddc8 100644
--- a/addons/web/static/src/js/widgets/domain_selector_dialog.js
+++ b/addons/web/static/src/js/widgets/domain_selector_dialog.js
@@ -12,7 +12,6 @@ return Dialog.extend({
this.model = model;
this.options = _.extend({
readonly: true,
- fs_filters: {},
debugMode: false,
}, options || {});
diff --git a/addons/web/static/src/js/widgets/model_field_selector.js b/addons/web/static/src/js/widgets/model_field_selector.js
index 109b7ead7df..35c9e00d077 100644
--- a/addons/web/static/src/js/widgets/model_field_selector.js
+++ b/addons/web/static/src/js/widgets/model_field_selector.js
@@ -119,8 +119,9 @@ var ModelFieldSelector = Widget.extend({
/// @param model - a string with the model name (e.g. "res.partner")
/// @param chain - a string with the initial field chain (e.g. "company_id.name")
/// @param options - an object with several options:
- /// - filters: an object which contains a series of filters to use
- /// - debugMode: a boolean which is true if the widget is in debug mode
+ /// - filters: an object which contains suboptions which determine the fields which are used
+ /// - searchable: a boolean which is true if only the searchable fields have to be used (true by default)
+ /// - debugMode: a boolean which is true if the widget is in debug mode (false by default)
init: function (parent, model, chain, options) {
this._super.apply(this, arguments);
@@ -130,6 +131,9 @@ var ModelFieldSelector = Widget.extend({
filters: {},
debugMode: false,
}, options || {});
+ this.options.filters = _.extend({
+ searchable: true,
+ }, this.options.filters);
this.pages = [];
this.selectedField = false;
@@ -307,7 +311,6 @@ var fieldsCache = {
return this.cacheDefs[model];
},
filter: function (model, filters) {
- filters = _.defaults(filters || {}, {searchable: true});
return _.filter(this.cache[model], function (f) {
return !filters.searchable || f.searchable;
});