diff options
| author | vta vta@openerp.com <> | 2012-10-10 13:41:58 +0200 |
|---|---|---|
| committer | vta vta@openerp.com <> | 2012-10-10 13:41:58 +0200 |
| commit | 95aaa7f926104db0ed6580eec04d64a41dddecd3 (patch) | |
| tree | 814aecb2ebc16bf7d1c5e2de8e5554a955ffbc56 | |
| parent | 4c7f416dd4b2689a38a6be14a4bcaeeb44583ca7 (diff) | |
| parent | 46b5ac9a377c9470b20aae0e8bdbdf0d359871af (diff) | |
[MERGE] trunk-trigger-on_button_cancel.
bzr revid: vta@openerp.com-20121010114158-ktm6gbfdcsax4uxe
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 9 | ||||
| -rw-r--r-- | addons/web_view_editor/static/src/js/view_editor.js | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 9315ce15d1a..4bdc122b690 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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() { diff --git a/addons/web_view_editor/static/src/js/view_editor.js b/addons/web_view_editor/static/src/js/view_editor.js index f26e12a55d7..40d333afa0f 100644 --- a/addons/web_view_editor/static/src/js/view_editor.js +++ b/addons/web_view_editor/static/src/js/view_editor.js @@ -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'); |
