[IMP] Connection: add utility method that bind() then login()
authorChristophe Simonis <chs@openerp.com>
Thu, 17 Nov 2011 12:49:26 +0000 (13:49 +0100)
committerChristophe Simonis <chs@openerp.com>
Thu, 17 Nov 2011 12:49:26 +0000 (13:49 +0100)
bzr revid: chs@openerp.com-20111117124926-y3z3osoq76va0kjy

addons/web/static/src/js/core.js

index 8d7bed5..113b83f 100644 (file)
@@ -385,6 +385,13 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
         this.do_load_qweb(['/web/webclient/qweb'], continuation);
     },
 
+    connect: function(server, db, login, password, continuation) {
+        var self = this;
+        this.bind(server, function() {
+            self.login(db, login, password, continuation);
+        });
+    },
+
     get_absolute_url: function(path) {
         var r_has_protocol = /^https?:\/\//,
             r_absolute_internal = /^\/[^\/]/;   // starts with / (but not //)