diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 7c82d2b173f..2d1a06173cd 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1849,7 +1849,7 @@ var Collection = instance.web.Class.extend(/** @lends Collection# */{ * @returns this */ remove: function (record) { - var index = _(this.records).indexOf(record); + var index = this.indexOf(record); if (index === -1) { _(this._proxies).each(function (proxy) { proxy.remove(record); @@ -1885,12 +1885,14 @@ var Collection = instance.web.Class.extend(/** @lends Collection# */{ // underscore-type methods find: function (callback) { - var record = null; + var record; for(var section in this._proxies) { - if (this._proxies.hasOwnProperty(section)) { - record = this._proxies[section].find(callback); + if (!this._proxies.hasOwnProperty(section)) { + continue + } + if ((record = this._proxies[section].find(callback))) { + return record; } - if (record) { return record; } } for(var i=0; i