summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorDenis Ledoux <dle@openerp.com>2014-04-04 17:09:14 +0200
committerDenis Ledoux <dle@openerp.com>2014-04-04 17:09:14 +0200
commit72e7a75eaee370f2de698832d397af5c2d30f005 (patch)
treed0831150d2838521e029d631ed8aead1ddcbddea /addons/web/static/src
parent92266424368ac7d41363ed36a7f1ca5cf58bc970 (diff)
parentc0db6aec56d383d173fa56b1a2dec2e42495911b (diff)
[FIX] web: do not reload record on dialog close if the wizard return an action
bzr revid: dle@openerp.com-20140404150914-vxx06gl0xv43ddv2
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/chrome.js10
-rw-r--r--addons/web/static/src/js/view_form.js6
-rw-r--r--addons/web/static/src/js/views.js8
3 files changed, 12 insertions, 12 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index add30866111..e893873a31e 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -105,9 +105,6 @@ instance.web.Dialog = instance.web.Widget.extend({
autoOpen: false,
position: [false, 40],
buttons: null,
- beforeClose: function () {
- self.trigger("closing");
- },
resizeStop: function() {
self.trigger("resized");
},
@@ -208,8 +205,9 @@ instance.web.Dialog = instance.web.Widget.extend({
/**
Closes the popup, if destroy_on_close was passed to the constructor, it is also destroyed.
*/
- close: function() {
+ close: function(reason) {
if (this.dialog_inited && this.$el.is(":data(dialog)")) {
+ this.trigger("closing", reason);
this.$el.dialog('close');
}
},
@@ -225,14 +223,14 @@ instance.web.Dialog = instance.web.Widget.extend({
/**
Destroys the popup, also closes it.
*/
- destroy: function () {
+ destroy: function (reason) {
this.$buttons.remove();
_.each(this.getChildren(), function(el) {
el.destroy();
});
if (! this.__tmp_dialog_closing) {
this.__tmp_dialog_destroying = true;
- this.close();
+ this.close(reason);
this.__tmp_dialog_destroying = undefined;
}
if (this.dialog_inited && !this.isDestroyed() && this.$el.is(":data(dialog)")) {
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index fd838686ba9..ce2de551e53 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -1982,8 +1982,10 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({
return this.view.do_execute_action(
_.extend({}, this.node.attrs, {context: context}),
- this.view.dataset, this.view.datarecord.id, function () {
- self.view.recursive_reload();
+ this.view.dataset, this.view.datarecord.id, function (reason) {
+ if (!_.isObject(reason)) {
+ self.view.recursive_reload();
+ }
});
},
check_disable: function() {
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index b2bd33b393a..e3e91752f4d 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -25,9 +25,9 @@ instance.web.ActionManager = instance.web.Widget.extend({
this._super.apply(this, arguments);
this.$el.on('click', 'a.oe_breadcrumb_item', this.on_breadcrumb_clicked);
},
- dialog_stop: function () {
+ dialog_stop: function (reason) {
if (this.dialog) {
- this.dialog.destroy();
+ this.dialog.destroy(reason);
}
this.dialog = null;
},
@@ -408,7 +408,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
if (this.dialog_widget && !this.dialog_widget.isDestroyed()) {
this.dialog_widget.destroy();
}
- this.dialog_stop();
+ this.dialog_stop(executor.action);
this.dialog = new instance.web.Dialog(this, {
dialogClass: executor.klass,
});
@@ -426,7 +426,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
this.dialog.open();
return initialized;
} else {
- this.dialog_stop();
+ this.dialog_stop(executor.action);
this.inner_action = executor.action;
this.inner_widget = widget;
executor.post_process(widget);