[MERGE] trunk-trigger-on_button_cancel.
bzr revid: vta@openerp.com-20121010114158-ktm6gbfdcsax4uxe
This commit is contained in:
@@ -173,10 +173,10 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
||||
} else {
|
||||
this.$el.find('.oe_form_buttons').replaceWith(this.$buttons);
|
||||
}
|
||||
this.$buttons.on('click','.oe_form_button_create',this.on_button_create);
|
||||
this.$buttons.on('click','.oe_form_button_edit',this.on_button_edit);
|
||||
this.$buttons.on('click','.oe_form_button_save',this.on_button_save);
|
||||
this.$buttons.on('click','.oe_form_button_cancel',this.on_button_cancel);
|
||||
this.$buttons.on('click', '.oe_form_button_create', this.on_button_create);
|
||||
this.$buttons.on('click', '.oe_form_button_edit', this.on_button_edit);
|
||||
this.$buttons.on('click', '.oe_form_button_save', this.on_button_save);
|
||||
this.$buttons.on('click', '.oe_form_button_cancel', this.on_button_cancel);
|
||||
|
||||
this.$sidebar = this.options.$sidebar || this.$el.find('.oe_form_sidebar');
|
||||
if (!this.sidebar && this.options.$sidebar) {
|
||||
@@ -760,6 +760,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
||||
this.trigger('load_record', this.datarecord);
|
||||
}
|
||||
}
|
||||
this.trigger('on_button_cancel');
|
||||
return false;
|
||||
},
|
||||
on_button_new: function() {
|
||||
|
||||
@@ -1014,7 +1014,9 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
||||
var action_manager = new instance.web.ActionManager(self);
|
||||
$.when(action_manager.do_action(action)).then(function() {
|
||||
var controller = action_manager.dialog_widget.views['form'].controller;
|
||||
controller.on("on_button_cancel",self,action_manager.destroy);
|
||||
controller.on("on_button_cancel", self, function(){
|
||||
action_manager.destroy();
|
||||
});
|
||||
controller.do_save.add_last(function(){
|
||||
action_manager.destroy();
|
||||
var value =controller.fields.name.get('value');
|
||||
|
||||
Reference in New Issue
Block a user