summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/data.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-03-22 15:25:40 +0100
committerXavier Morel <xmo@openerp.com>2012-03-22 15:25:40 +0100
commit514c63288c7d5d88d764b44696c5e3a5fc148dfb (patch)
tree075c75ad87a86dba2a33abd1601f77d51f70d60a /addons/web/static/src/js/data.js
parent83221bd1f1be436fa5cddaac6edf4e3ebfa64dfa (diff)
[FIX] change dataset.read_index to be implemented in terms of dataset.read_ids, not in terms of model.first() as not all model data is kept/transferred (filters are not bubbled?)
bzr revid: xmo@openerp.com-20120322142540-x3j9p7kub2px6p6v
Diffstat (limited to 'addons/web/static/src/js/data.js')
-rw-r--r--addons/web/static/src/js/data.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js
index 0dc60c0e031..b3ed5b08280 100644
--- a/addons/web/static/src/js/data.js
+++ b/addons/web/static/src/js/data.js
@@ -623,12 +623,9 @@ openerp.web.DataSet = openerp.web.OldWidget.extend( /** @lends openerp.web.Data
*/
read_index: function (fields, options) {
options = options || {};
- // not very good
- return this._model.query(fields)
- .context(options.context)
- .offset(this.index).first().pipe(function (record) {
- if (!record) { return $.Deferred().reject().promise(); }
- return record;
+ return this.read_ids([this.ids[this.index]], fields, options).pipe(function (records) {
+ if (_.isEmpty(records)) { return $.Deferred().reject().promise(); }
+ return records[0];
});
},
/**