diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-06-21 12:11:03 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-06-21 12:11:03 +0200 |
| commit | ace69b6921e3c9e004c83436e653d24fcb3a6786 (patch) | |
| tree | 1443ebde09ca1e305e5a7f0685cd8b7f8d29ab59 /addons/web/static/src | |
| parent | 326d6f419a196f7e21c94cb5b385409630bbf54f (diff) | |
| parent | 63717f865167ae99e14129cd7f9f847c8dfa8113 (diff) | |
[MERGE] move filtering of non-searchable fields to prune the fields list itself
if only the *display* list is filtered, the advanced search engine may
still attempt to *select* a non-searchable field (if it's the first
one) leading to broken/nonsensical behavior.
Non-searchable fields should be removed from the advanced search's
ability to find them altogether.
bzr revid: xmo@openerp.com-20120621101103-k842i8h1rxlr4n9k
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/search.js | 3 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 8cb15470349..d89c5679397 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1227,7 +1227,8 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** init: function (parent, fields) { this._super(parent); this.fields = _(fields).chain() - .map(function(val, key) { return _.extend({}, val, {'name': key}); }) + .map(function(val, key) {return _.extend({}, val, {'name': key}); }) + .filter(function(field){return typeof field.store === 'undefined' || field.store || field.fnct_search}) .sortBy(function(field) {return field.string;}) .value(); this.attrs = {_: _, fields: this.fields, selected: null}; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 35d2a02cb0b..141e23a93b9 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1442,8 +1442,7 @@ <div t-att-id="widget.element_id"> <select class="searchview_extended_prop_field"> <t t-foreach="widget.attrs.fields" t-as="field"> - <option t-if="typeof field.store === 'undefined' || field.store || field.fnct_search" - t-att="{'selected': field === widget.attrs.selected ? 'selected' : null}" + <option t-att="{'selected': field === widget.attrs.selected ? 'selected' : null}" t-att-value="field.name"> <t t-esc="field.string"/> </option> |
