diff options
| author | Martin Trigaux <mat@openerp.com> | 2014-02-18 11:14:38 +0100 |
|---|---|---|
| committer | Martin Trigaux <mat@openerp.com> | 2014-02-18 11:14:38 +0100 |
| commit | 2e831ab7c377408782ab96c303f6fa50884d76e4 (patch) | |
| tree | 9e88b2dcd0cb4383e98f07f6b8b9777494cf8389 /addons/web/static/src/js/data.js | |
| parent | e1dff484923c5579a4f6a72ab9c8a97883992a02 (diff) | |
[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
Diffstat (limited to 'addons/web/static/src/js/data.js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index abfb4c15347..04b02294463 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -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', |
