summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-01-20 13:49:30 +0100
committerXavier Morel <xmo@openerp.com>2012-01-20 13:49:30 +0100
commit7b38be73702ad7bf41a7332b64d07ae9aa047672 (patch)
treeb7491e143c3dee8ad7add44eb851aedac2580244 /addons/web/static/src/js
parent217c180fa29514e67e54e13f4eca515e9a649c3b (diff)
[FIX] DataSetStatic.read_slice called with no options should not blow up
lp bug: https://launchpad.net/bugs/919161 fixed bzr revid: xmo@openerp.com-20120120124930-zug80i862x9mwu34
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/data.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js
index bb53fb2175a..a4d9e9e4d71 100644
--- a/addons/web/static/src/js/data.js
+++ b/addons/web/static/src/js/data.js
@@ -309,7 +309,7 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet
* domain and context.
*
* @param {Array} [fields] fields to read and return, by default all fields are returned
- * @params {Object} options
+ * @params {Object} [options]
* @param {Number} [options.offset=0] The index from which selected records should be returned
* @param {Number} [options.limit=null] The maximum number of records to return
* @returns {$.Deferred}
@@ -504,11 +504,11 @@ openerp.web.DataSetStatic = openerp.web.DataSet.extend({
this.ids = ids || [];
},
read_slice: function (fields, options) {
+ options = options || {};
+ fields = fields || {};
// TODO remove fields from options
- var self = this,
- offset = options.offset || 0,
- limit = options.limit || false,
- fields = fields || false;
+ var offset = options.offset || 0,
+ limit = options.limit || false;
var end_pos = limit && limit !== -1 ? offset + limit : this.ids.length;
return this.read_ids(this.ids.slice(offset, end_pos), fields);
},
@@ -560,8 +560,8 @@ openerp.web.DataSetSearch = openerp.web.DataSet.extend(/** @lends openerp.web.D
* @returns {$.Deferred}
*/
read_slice: function (fields, options) {
+ options = options || {};
var self = this;
- var options = options || {};
var offset = options.offset || 0;
return this.rpc('/web/dataset/search_read', {
model: this.model,