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