From fe88c437fe025219a7097076c481f1b3c3ababbd Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 8 Jul 2011 13:37:04 +0200 Subject: [PATCH] [IMP] correctly use underscore, remove 4 useless lines bzr revid: xmo@openerp.com-20110708113704-lulvihowvrd7zhkg --- addons/base/static/src/js/form.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index e8fe70c7f2d..2624759dece 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -1116,12 +1116,8 @@ openerp.base.form.FieldSelection = openerp.base.form.Field.extend({ init: function(view, node) { this._super(view, node); this.template = "FieldSelection"; - this.field_index = []; - var self = this; - var i = 0; - _.each(this.field.selection, function(x) { - self.field_index.push({"ikey": "" + i, "ekey": x[0], "label": x[1]}); - i = i + 1; + this.field_index = _.map(this.field.selection, function(x, index) { + return {"ikey": "" + index, "ekey": x[0], "label": x[1]}; }); }, start: function() {