[FIX] broken implementation of collection#find

bzr revid: xmo@openerp.com-20120702110504-9fga0xwo0e5bzq1c
This commit is contained in:
Xavier Morel 2012-07-02 13:05:04 +02:00
parent ac2895fd62
commit 718ae91920
1 changed files with 4 additions and 2 deletions

View File

@ -1853,8 +1853,10 @@ var Collection = instance.web.Class.extend(/** @lends Collection# */{
if (record) { return record; }
}
for(var i=0; i<this.length; ++i) {
record = callback(this.records[i]);
if (record) { return record; }
record = this.records[i];
if (callback(record)) {
return record;
}
}
},
each: function (callback) {