From e43790f7f2e04782f9d52851ec48edaadabcf5b6 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 28 Sep 2011 17:16:13 +0200 Subject: [imp] refactoring to improve the way the components are destroyed bzr revid: nicolas.vanhoren@openerp.com-20110928151613-8suxvi1rzn9t40gd --- addons/web/static/src/js/data.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'addons/web/static/src/js/data.js') diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 00281628e75..1652ee62cb9 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -233,6 +233,7 @@ openerp.web.StaticDataGroup = openerp.web.GrouplessDataGroup.extend( /** @lends }); openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet# */{ + identifier_prefix: "dataset", /** * DateaManagement interface between views and the collection of selected * OpenERP records (represents the view's state?) @@ -242,16 +243,12 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet * * @param {String} model the OpenERP model this dataset will manage */ - init: function(source_controller, model, context) { - // we don't want the dataset to be a child of anything! - this._super(null); - this.session = source_controller ? source_controller.session : undefined; + init: function(parent, model, context) { + this._super(parent); this.model = model; this.context = context || {}; this.index = null; }, - start: function() { - }, previous: function () { this.index -= 1; if (this.index < 0) { @@ -549,13 +546,11 @@ openerp.web.DataSetSearch = openerp.web.DataSet.extend(/** @lends openerp.web.D sort: this.sort(), offset: offset, limit: options.limit || false - }, function (result) { + }).pipe(function (result) { self.ids = result.ids; self.offset = offset; - if (callback) { - callback(result.records); - } - }); + return result.records; + }).then(callback); }, get_domain: function (other_domain) { if (other_domain) { -- cgit v1.2.3