[FIX] close dialog on cancel form.

lp bug: https://launchpad.net/bugs/905375 fixed

bzr revid: fme@openerp.com-20111221135716-6skqmki0hqd8fudn
This commit is contained in:
Fabien Meghazi 2011-12-21 14:57:16 +01:00
commit 2d480dacee
1 changed files with 4 additions and 0 deletions

View File

@ -419,6 +419,7 @@ openerp.web_calendar.CalendarFormDialog = openerp.web.Dialog.extend({
this.view = view;
},
start: function() {
var self = this;
this._super();
this.form = new openerp.web.FormView(this, this.dataset, this.view_id, {
sidebar: false,
@ -427,6 +428,9 @@ openerp.web_calendar.CalendarFormDialog = openerp.web.Dialog.extend({
this.form.appendTo(this.$element);
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_button_cancel = function() {
self.close();
}
},
on_form_dialog_saved: function() {
var id = this.dataset.ids[this.dataset.index];