[MERGE] url tolerance

bzr revid: al@openerp.com-20120416233207-3sven3wtqt1adlob
This commit is contained in:
Antony Lesuisse 2012-04-17 01:32:07 +02:00
commit d71662bd7c
1 changed files with 4 additions and 1 deletions

View File

@ -1918,7 +1918,10 @@ openerp.web.form.FieldUrl = openerp.web.form.FieldChar.extend({
if (!this.value) {
this.do_warn("Resource error", "This resource is empty");
} else {
window.open(this.value);
var url = $.trim(this.value);
if(/^www\./i.test(url))
url = 'http://'+url;
window.open(url);
}
}
});