summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-01-31 10:43:26 +0100
committerXavier Morel <xmo@openerp.com>2012-01-31 10:43:26 +0100
commit73c1d7c3de06fcefee69f2907b1ae2a64dcdb65b (patch)
tree3b77f9b94f6cd29fa82e682c179a4fb9c48adb3d /addons/web/static/src/js/chrome.js
parent52fc5d502371c20cefcc02c8ff31ea0ff0425a03 (diff)
[FIX] handling of being denied access to the list of databases in the database-management screen
lp bug: https://launchpad.net/bugs/922024 fixed bzr revid: xmo@openerp.com-20120131094326-1am82v8u6f9fefuv
Diffstat (limited to 'addons/web/static/src/js/chrome.js')
-rw-r--r--addons/web/static/src/js/chrome.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index 2a470098c39..a28cd6f9a7b 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -286,9 +286,9 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
this.$option_id = $("#oe_db_options");
var self = this;
- var fetch_db = this.rpc("/web/database/get_list", {}, function(result) {
- self.db_list = result.db_list;
- });
+ var fetch_db = this.rpc("/web/database/get_list", {}).pipe(
+ function(result) { self.db_list = result.db_list; },
+ function (_, ev) { ev.preventDefault(); self.db_list = null; });
var fetch_langs = this.rpc("/web/session/get_lang_list", {}, function(result) {
if (result.error) {
self.display_error(result);
@@ -423,9 +423,11 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
self.display_error(result);
return;
}
- self.db_list.push(self.to_object(fields)['db_name']);
- self.db_list.sort();
- self.widget_parent.set_db_list(self.db_list);
+ if (self.db_list) {
+ self.db_list.push(self.to_object(fields)['db_name']);
+ self.db_list.sort();
+ 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'],
@@ -454,8 +456,10 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
return;
}
$db_list.find(':selected').remove();
- self.db_list.splice(_.indexOf(self.db_list, db, true), 1);
- self.widget_parent.set_db_list(self.db_list);
+ if (self.db_list) {
+ self.db_list.splice(_.indexOf(self.db_list, db, true), 1);
+ self.widget_parent.set_db_list(self.db_list);
+ }
self.do_notify("Dropping database", "The database '" + db + "' has been dropped");
});
}