summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/data.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-02-28 14:03:21 +0100
committerXavier Morel <xmo@openerp.com>2012-02-28 14:03:21 +0100
commitf26eff28a9a0af862eadcea90bf97bfae6c108f2 (patch)
tree0d816b31bf51d26ccb8e41372bbc62adf3621d7d /addons/web/static/src/js/data.js
parente6f5d4c211e00ad8ce5f6cae24a65875c2bccf7c (diff)
[FIX] typos
bzr revid: xmo@openerp.com-20120228130321-rzxy8axbqtnjr1ze
Diffstat (limited to 'addons/web/static/src/js/data.js')
-rw-r--r--addons/web/static/src/js/data.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js
index 58e491cc52c..aa760e7df44 100644
--- a/addons/web/static/src/js/data.js
+++ b/addons/web/static/src/js/data.js
@@ -88,7 +88,7 @@ openerp.web.Query = openerp.web.Class.extend({
},
count: function () {
if (this._count) { return $.when(this._count); }
- return this.model.call(
+ return this._model.call(
'search_count', [this._filter], {
context: this._model.context(this._context)});
},
@@ -449,6 +449,7 @@ openerp.web.DataSet = openerp.web.OldWidget.extend( /** @lends openerp.web.Data
* @returns {$.Deferred}
*/
read_ids: function (ids, fields, options) {
+ options = options || {};
// TODO: reorder results to match ids list
return this._model.call('read',
[ids, fields || false],
@@ -485,6 +486,7 @@ openerp.web.DataSet = openerp.web.OldWidget.extend( /** @lends openerp.web.Data
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;
@@ -738,9 +740,10 @@ openerp.web.DataSetSearch = openerp.web.DataSet.extend(/** @lends openerp.web.D
.offset(options.offset || 0)
.limit(options.limit || false);
q = q.order_by.apply(q, this._sort);
+
return q.all().then(function (records) {
// FIXME: not sure about that one, *could* have discarded count
- q.count().then(function (count) { this._length = count; });
+ q.count().then(function (count) { self._length = count; });
self.ids = _(records).pluck('id');
});
},