diff options
| author | Xavier Morel <xmo@openerp.com> | 2013-09-06 17:01:01 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2013-09-06 17:01:01 +0200 |
| commit | 4a1d3f16ce06b0b09717626c729d36c65b5d7c43 (patch) | |
| tree | 89555a25fa9066e8e92255ae2abc93e5c82805fb /addons/web/static/src/js | |
| parent | 6da5da7aa00b9fdb84e8133944980dd981b0fc0d (diff) | |
[FIX] broken pager
Turns out when code looks somewhat odd there may well be a good reason
for it, and changing it without wondering breaks the pager.
In this case, `/web/dataset/search_read` has a significant difference
with Model.search_read: it returns the records slice specified by
(``limit``, ``offset``) but it also returns the *total number of
records* for ``domain`` which is sort-of useful to generating the
pager.
lp bug: https://launchpad.net/bugs/1218266 fixed
bzr revid: xmo@openerp.com-20130906150101-2qb349fzaz6rye36
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 26807a2ee0f..a4fbb364a21 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -61,18 +61,19 @@ instance.web.Query = instance.web.Class.extend({ }, _execute: function () { var self = this; - return this._model.call('search_read', { + return instance.session.rpc('/web/dataset/search_read', { + model: this._model.name, + fields: this._fields || false, domain: instance.web.pyeval.eval('domains', [this._model.domain(this._filter)]), - fields: this._fields || false, - offset: this._offset, - limit: this._limit, - order: instance.web.serialize_sort(this._order_by), context: instance.web.pyeval.eval('contexts', [this._model.context(this._context)]), + offset: this._offset, + limit: this._limit, + sort: instance.web.serialize_sort(this._order_by) }).then(function (results) { self._count = results.length; - return results; + return results.records; }, null); }, /** |
