[IMP] Remove add_last in on_saved method

bzr revid: ggh@tinyerp.com-20121008110346-r0dzmjy3161bxglb
This commit is contained in:
ggh-openerp 2012-10-08 16:33:46 +05:30
parent 55bcd978af
commit 4dd9a36f6e
3 changed files with 5 additions and 4 deletions

View File

@ -131,6 +131,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
e.preventDefault(); e.preventDefault();
} }
}); });
self.on("on_rec_save", self, self.on_saved);
}, },
destroy: function() { destroy: function() {
_.each(this.get_widgets(), function(w) { _.each(this.get_widgets(), function(w) {
@ -868,7 +869,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
self.force_dirty = false; self.force_dirty = false;
// Write save // Write save
save_deferral = self.dataset.write(self.datarecord.id, values, {}).pipe(function(r) { save_deferral = self.dataset.write(self.datarecord.id, values, {}).pipe(function(r) {
return self.on_saved(r); return self.trigger('on_rec_save', r);
}, null); }, null);
} }
return save_deferral; return save_deferral;
@ -1628,7 +1629,7 @@ instance.web.form.FormDialog = instance.web.Dialog.extend({
}); });
this.form.appendTo(this.$el); this.form.appendTo(this.$el);
this.form.on_created.add_last(this.on_form_dialog_saved); this.form.on_created.add_last(this.on_form_dialog_saved);
this.form.on_saved.add_last(this.on_form_dialog_saved); this.form.on('on_rec_save', this, this.on_form_dialog_saved);
return this; return this;
}, },
select_id: function(id) { select_id: function(id) {

View File

@ -459,7 +459,7 @@ instance.web_calendar.CalendarFormDialog = instance.web.Dialog.extend({
}); });
var def = this.form.appendTo(this.$el); var def = this.form.appendTo(this.$el);
this.form.on_created.add_last(this.on_form_dialog_saved); this.form.on_created.add_last(this.on_form_dialog_saved);
this.form.on_saved.add_last(this.on_form_dialog_saved); this.form.on('on_rec_save', self, this.on_form_dialog_saved);
this.form.on_button_cancel = function() { this.form.on_button_cancel = function() {
self.close(); self.close();
} }

View File

@ -673,7 +673,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
var am = instance.webclient.action_manager; var am = instance.webclient.action_manager;
var form = am.dialog_widget.views.form.controller; var form = am.dialog_widget.views.form.controller;
form.on_button_cancel.add_last(am.dialog.on_close); form.on_button_cancel.add_last(am.dialog.on_close);
form.on_saved.add_last(function() { form.on('on_rec_save', self, function() {
am.dialog.on_close(); am.dialog.on_close();
self.view.do_reload(); self.view.do_reload();
}); });