diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-05-31 15:01:54 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-05-31 15:01:54 +0200 |
| commit | f6d4bdc55539bd25056aff41a3d9d27cdd306299 (patch) | |
| tree | beb5105e0898de74b32a7112934da1c054cc04ea /addons/base/static/src/js/data.js | |
| parent | 9a5058a6b478b7778f9e824d1177b4daf82434dd (diff) | |
Import old branch.
bzr revid: nicolas.vanhoren@openerp.com-20110531130154-45t27asxk5pcr7sd
Diffstat (limited to 'addons/base/static/src/js/data.js')
| -rw-r--r-- | addons/base/static/src/js/data.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index 7582e99b662..b4583e9a902 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -310,6 +310,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base. }, callback); }, unlink: function(ids) { + // to implement in children this.notification.notify("Unlink", ids); }, call: function (method, ids, args, callback) { @@ -343,15 +344,25 @@ openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base. }); openerp.base.DataSetStatic = openerp.base.DataSet.extend({ - init: function(session, model) { + init: function(session, model, ids) { this._super(session, model); // all local records - this.ids = []; - this.count = 0; + this.ids = ids || []; + this.count = this.ids.length; }, read_slice: function (fields, offset, limit, callback) { var end_pos = limit && limit !== -1 ? offset + limit : undefined; this.read_ids(this.ids.slice(offset, end_pos), fields, callback); + }, + set_ids: function (ids) { + this.ids = ids; + this.count = this.ids.length; + }, + unlink: function(ids) { + this.on_unlink(ids); + }, + on_unlink: function(ids) { + // event } }); |
