Merge lp:~openerp-dev/openerp-web/6.1-opw-579621-msh into lp:openerp-web/6.1

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/6.1-opw-579621-msh
Merge into: lp:openerp-web/6.1
Diff against target: 14 lines (+4/-0)
1 file modified
addons/web/static/src/js/view_form.js (+4/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/6.1-opw-579621-msh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+126215@code.launchpad.net

Description of the change

Hello,

Fixed the issue of URL widget which does not open URL when protocol not defined in value.

Demo :- Enter any URL for example openerp.com without protocol and click on button "Open Resource", Here protocol is not defined due to which window.open method will not open URL properly, hence by default used http same as page view.

Thanks.

To post a comment you must log in.

Unmerged revisions

2461. By Mohammed Shekha(Open ERP)

[FIX]Fixed the issue of URL widget which does not open URL if there is no protocol defined in the value, hence put http as a default value if there is no protocol defined same as page view.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/view_form.js'
2--- addons/web/static/src/js/view_form.js 2012-09-24 15:26:28 +0000
3+++ addons/web/static/src/js/view_form.js 2012-09-25 10:53:09 +0000
4@@ -1591,6 +1591,10 @@
5 if (!this.value) {
6 this.do_warn(_t("Resource error"), _t("This resource is empty"));
7 } else {
8+ var s = /(\w+):(.+)/.exec(this.value);
9+ if (!s) {
10+ this.value = "http://" + this.value;
11+ }
12 window.open(this.value);
13 }
14 }