diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-03-22 12:31:42 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-03-22 12:31:42 +0100 |
| commit | 1da49a44a57aa413e5eb96afe9c6d294e09848fd (patch) | |
| tree | 77a4158ac5a2a6fa8be77f13402be81178849bd6 /addons/web/static/src/js/chrome.js | |
| parent | ff245d6eb5e0b5f34d9bbaab963e99afa4897e3f (diff) | |
| parent | 5a5791474a495d230f997c69cb24405722c8f407 (diff) | |
[MERGE] 6.1 fixes into trunk
bzr revid: xmo@openerp.com-20120322113142-gim4svx01p336nxm
Diffstat (limited to 'addons/web/static/src/js/chrome.js')
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 56 |
1 files changed, 7 insertions, 49 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 829610f2988..f8af815d187 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -351,44 +351,6 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab return result; }, /** - * Waits until the new database is done creating, then unblocks the UI and - * logs the user in as admin - * - * @param {Number} db_creation_id identifier for the db-creation operation, used to fetch the current installation progress - * @param {Object} info info fields for this database creation - * @param {String} info.db name of the database being created - * @param {String} info.password super-admin password for the database - */ - wait_for_newdb: function (db_creation_id, info) { - var self = this; - self.rpc('/web/database/progress', { - id: db_creation_id, - password: info.password - }, function (result) { - var progress = result[0]; - // I'd display a progress bar, but turns out the progress status - // the server report kind-of blows goats: it's at 0 for ~75% of - // the installation, then jumps to 75%, then jumps down to either - // 0 or ~40%, then back up to 75%, then terminates. Let's keep that - // mess hidden behind a not-very-useful but not overly weird - // message instead. - if (progress < 1) { - setTimeout(function () { - self.wait_for_newdb(db_creation_id, info); - }, 500); - return; - } - - var admin = result[1][0]; - setTimeout(function () { - self.getParent().do_login( - info.db, admin.login, admin.password); - self.destroy(); - self.unblockUI(); - }); - }); - }, - /** * Blocks UI and replaces $.unblockUI by a noop to prevent third parties * from unblocking the UI */ @@ -427,23 +389,19 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab self.$option_id.find("form[name=create_db_form]").validate({ submitHandler: function (form) { var fields = $(form).serializeArray(); - self.blockUI(); self.rpc("/web/database/create", {'fields': fields}, function(result) { - if (result.error) { - self.unblockUI(); - self.display_error(result); - return; - } if (self.db_list) { self.db_list.push(self.to_object(fields)['db_name']); self.db_list.sort(); - self.getParent().set_db_list(self.db_list); + self.widget_parent.set_db_list(self.db_list); } + var form_obj = self.to_object(fields); - self.wait_for_newdb(result, { - password: form_obj['super_admin_pwd'], - db: form_obj['db_name'] - }); + self.getParent().do_login( + form_obj['db_name'], + 'admin', + form_obj['create_admin_pwd']); + self.destroy(); }); } }); |
