[FIX] broken implementation of collection#find
bzr revid: xmo@openerp.com-20120702110504-9fga0xwo0e5bzq1c
This commit is contained in:
parent
ac2895fd62
commit
718ae91920
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue