[IMP] Connection: add utility method that bind() then login()

bzr revid: chs@openerp.com-20111117124926-y3z3osoq76va0kjy
This commit is contained in:
Christophe Simonis 2011-11-17 13:49:26 +01:00
parent a113e971fb
commit 4e85f0762c
1 changed files with 7 additions and 0 deletions

View 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 //)