[FIX] move reload-webclient-on-module-install to act_window execution
A special case reloads the Webclient if a dialog-included operation
involving potential module installation (base.module.upgrade, or
base.setup.installer) is involved.
This was performed on an act_close, but it meant a module-involving
act_window followed by a non-module-involving act_window
(e.g. installation of a chart of account) did not match the check
criteria and failed to trigger the reloading of the web client.
Check moved to act_window execution, and augments the on_close handler
bound to the dialog's closing any time a potential module installation
(see above) is encountered, to ensure we don't "lose" cases, such as
the installation of the `sales` application (from "add more
features"), which was the issue in the related lp bug.
lp bug: https://launchpad.net/bugs/887459 fixed
bzr revid: xmo@openerp.com-20111128144726-aurpni1go73ezs6y
This commit is contained in:
@@ -91,6 +91,14 @@ session.web.ActionManager = session.web.Widget.extend({
|
||||
return this[type](action, on_close);
|
||||
},
|
||||
ir_actions_act_window: function (action, on_close) {
|
||||
if (_(['base.module.upgrade', 'base.setup.installer'])
|
||||
.contains(action.res_model)) {
|
||||
var old_close = on_close;
|
||||
on_close = function () {
|
||||
session.webclient.do_reload();
|
||||
if (old_close) { old_close(); }
|
||||
};
|
||||
}
|
||||
if (action.target === 'new') {
|
||||
if (this.dialog == null) {
|
||||
this.dialog = new session.web.Dialog(this, { title: action.name, width: '80%' });
|
||||
@@ -121,12 +129,6 @@ session.web.ActionManager = session.web.Widget.extend({
|
||||
if (!this.dialog && on_closed) {
|
||||
on_closed();
|
||||
}
|
||||
if (this.dialog && action.context) {
|
||||
var model = action.context.active_model;
|
||||
if (model === 'base.module.upgrade' || model === 'base.setup.installer' || model === 'base.module.upgrade') {
|
||||
session.webclient.do_reload();
|
||||
}
|
||||
}
|
||||
this.dialog_stop();
|
||||
},
|
||||
ir_actions_server: function (action, on_closed) {
|
||||
|
||||
Reference in New Issue
Block a user