[IMP] Remove add_last in on_unlink method

bzr revid: ggh@tinyerp.com-20121009061618-ohsjlzf14jpqws2q
This commit is contained in:
ggh-openerp 2012-10-09 11:46:18 +05:30
parent 41daef35ed
commit 5ab21e13a3
2 changed files with 5 additions and 3 deletions

View File

@ -690,9 +690,11 @@ 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 || [];
self.on("on_rec_unlink", self, self.on_unlink);
},
read_slice: function (fields, options) {
options = options || {};
@ -711,7 +713,7 @@ instance.web.DataSetStatic = instance.web.DataSet.extend({
}
},
unlink: function(ids) {
this.on_unlink(ids);
this.trigger('on_rec_unlink', ids);
return $.Deferred().resolve({result: true});
},
on_unlink: function(ids) {

View File

@ -3998,7 +3998,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
this.dataset = new instance.web.form.Many2ManyDataSet(this, this.field.relation);
this.dataset.m2m = this;
this.dataset.on_unlink.add_last(function(ids) {
this.dataset.on('on_rec_unlink', self, function(ids) {
self.dataset_changed();
});
@ -4131,7 +4131,7 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend(
this.dataset = new instance.web.form.Many2ManyDataSet(this, this.field.relation);
this.dataset.m2m = this;
this.dataset.on_unlink.add_last(function(ids) {
this.dataset.on('on_rec_unlink', self, function(ids) {
self.dataset_changed();
});