diff options
| author | Jiten (OpenERP) <jra@tinyerp.com> | 2011-10-03 10:46:33 +0530 |
|---|---|---|
| committer | Jiten (OpenERP) <jra@tinyerp.com> | 2011-10-03 10:46:33 +0530 |
| commit | 10380b13431a981bd942a04c49c6afb69c19dc18 (patch) | |
| tree | 9c308f77f46f990c610dfbf0e63535e601210673 /addons/web/static/src/js/data.js | |
| parent | 3fba4c077a2343434f5f4a655d75dabb1a2ac7eb (diff) | |
| parent | 3a12aa8d7c6a22b6bf8431209bcd1dfec7b9a791 (diff) | |
[MERGE] Merge from openerp-web.
bzr revid: jra@tinyerp.com-20111003051633-9z4qdvet7rbz9z7p
Diffstat (limited to 'addons/web/static/src/js/data.js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 00281628e75..fcf6a65dcf5 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) { @@ -603,7 +598,6 @@ openerp.web.DataSetSearch = openerp.web.DataSet.extend(/** @lends openerp.web.D }); openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({ virtual_id_prefix: "one2many_v_id_", - virtual_id_regex: /one2many_v_id_.*/, debug_mode: true, init: function() { this._super.apply(this, arguments); @@ -724,6 +718,8 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({ return completion.promise(); } }); +openerp.web.BufferedDataSet.virtual_id_regex = /^one2many_v_id_.*$/; + openerp.web.ReadOnlyDataSetSearch = openerp.web.DataSetSearch.extend({ default_get: function(fields, callback) { return this._super(fields, callback).then(this.on_default_get); |
