[IMP] data: skip read_ids call when got no id (opw 604099).

This avoids making useless calls to to read the values of o2m fields when the read on a record already told us there was no ids.

bzr revid: mat@openerp.com-20140218101438-yqim33cvtg6wt4mw
This commit is contained in:
Martin Trigaux 2014-02-18 11:14:38 +01:00
parent e1dff48492
commit 2e831ab7c3
1 changed files with 3 additions and 0 deletions

View File

@ -428,6 +428,9 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin,
* @returns {$.Deferred}
*/
read_ids: function (ids, fields, options) {
if (_.isEmpty(ids))
return $.Deferred().resolve([]);
options = options || {};
// TODO: reorder results to match ids list
return this._model.call('read',