summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/data.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2012-10-11 11:32:52 +0200
committerChristophe Simonis <chs@openerp.com>2012-10-11 11:32:52 +0200
commit0e4df7d28bfcf6d6d3f853812f84b5fcd121dd29 (patch)
treeb39fb4de494e4e92b4697c8d4956d6d9e053608d /addons/web/static/src/js/data.js
parentfe495942e7e70e032ee2d9cc0e6c16b3b55d5bdd (diff)
parent70afbd796e441cce26171af03c26a08f88c3ab52 (diff)
merge upstream
bzr revid: chs@openerp.com-20121011093252-ke83ln88kw9em5y6
Diffstat (limited to 'addons/web/static/src/js/data.js')
-rw-r--r--addons/web/static/src/js/data.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js
index 220d42737da..ce85e0ac43f 100644
--- a/addons/web/static/src/js/data.js
+++ b/addons/web/static/src/js/data.js
@@ -575,6 +575,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
* @param {Number|String} ids identifier of the record to delete
*/
unlink: function(ids) {
+ this.trigger('unlink', ids);
return this._model.call('unlink', [ids], {context: this._model.context()});
},
/**
@@ -690,6 +691,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
instance.web.DataSetStatic = instance.web.DataSet.extend({
init: function(parent, model, context, ids) {
+ var self = this;
this._super(parent, model, context);
// all local records
this.ids = ids || [];
@@ -711,12 +713,10 @@ instance.web.DataSetStatic = instance.web.DataSet.extend({
}
},
unlink: function(ids) {
- this.on_unlink(ids);
+ this.set_ids(_.without.apply(null, [this.ids].concat(ids)));
+ this.trigger('unlink', ids);
return $.Deferred().resolve({result: true});
},
- on_unlink: function(ids) {
- this.set_ids(_.without.apply(null, [this.ids].concat(ids)));
- }
});
instance.web.DataSetSearch = instance.web.DataSet.extend({