[FIX] installing a module should trigger the launch of any pending configuration wizard

lp bug: https://launchpad.net/bugs/859483 fixed

bzr revid: xmo@openerp.com-20111003102721-d3eizbwef5ix18py
This commit is contained in:
Xavier Morel 2011-10-03 12:27:21 +02:00
parent 608274e292
commit 2dae9519d7
1 changed files with 14 additions and 4 deletions

View File

@ -94,8 +94,10 @@ openerp.web_default_home = function (openerp) {
})
},
install_module: function (module_name) {
var self = this;
var Modules = new openerp.web.DataSetSearch(
this, 'ir.module.module', null, [['name', '=', module_name], ['state', '=', 'uninstalled']]);
this, 'ir.module.module', null,
[['name', '=', module_name], ['state', '=', 'uninstalled']]);
var Upgrade = new openerp.web.DataSet(this, 'base.module.upgrade');
$.blockUI({message:'<img src="/web/static/src/img/throbber2.gif">'});
@ -105,13 +107,21 @@ openerp.web_default_home = function (openerp) {
[_.pluck(records, 'id'), 'to install', ['uninstalled']],
function () {
Upgrade.call('upgrade_module', [[]], function () {
$.unblockUI();
// TODO: less brutal reloading
window.location.reload(true);
self.run_configuration_wizards();
});
}
)
});
},
run_configuration_wizards: function () {
var self = this;
new openerp.web.DataSet(this, 'res.config').call('start', [[]], function (action) {
$.unblockUI();
self.do_action(action, function () {
// TODO: less brutal reloading
window.location.reload(true);
});
});
}
});
};