[FIX]Refixed the issue of filter, removed unnecessary variables and just put the filter on current chaining process.

bzr revid: msh@tinyerp.com-20120608103842-igqr6t9bxbdvd7i7
This commit is contained in:
msh-openerp 2012-06-08 16:08:42 +05:30
commit 6ae3c8dbaf
2 changed files with 3 additions and 3 deletions

View File

@ -1221,7 +1221,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}); })
.filter(function(field){return typeof field.store === 'undefined' || field.store || field.fnct_search})
.map(function(val, key) {return _.extend({}, val, {'name': key}); })
.sortBy(function(field) {return field.string;})
.value();
this.attrs = {_: _, fields: this.fields, selected: null};

View File

@ -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>