If the filter is executed first, the "iteratee" is transformed to an
array (from an object) and the "key" is lost, replaced by the indices
to the array (and thus the name of the fields end up as "0", "1", "2",
... instead of their actual logical names)

bzr revid: xmo@openerp.com-20130123084422-tbl05l5j72sx528n
This commit is contained in:
Xavier Morel 2013-01-23 09:44:22 +01:00
parent e355f5bb97
commit e5ad5f8e10
1 changed files with 1 additions and 1 deletions

View File

@ -1789,8 +1789,8 @@ instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @
init: function (parent, fields) {
this._super(parent);
this.fields = _(fields).chain()
.filter(function (field) { return !field.deprecated; })
.map(function(val, key) { return _.extend({}, val, {'name': key}); })
.filter(function (field) { return !field.deprecated; })
.sortBy(function(field) {return field.string;})
.value();
this.attrs = {_: _, fields: this.fields, selected: null};