Skip to main content
iVentureTeam

url

The url widget turns a char field into a link that opens in a new tab, quietly prefixes http:// when the scheme is missing, and hides one of Odoo's least known tricks: a text attribute that replaces the visible URL with friendly link text.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 12, 2026Updated August 12, 20266 min read
Odoo 19 form and list showing the url widget: an editable link field with globe icon and a list cell rendered as a clickable link.
Studio nameURL
Technical nameurl
Field typeschar
Viewsform (form.url variant), list, kanban
Form variantform.url, which keeps the input and adds the globe icon link
Moduleweb, present in every Odoo database
Used in core18 occurrences across 12 modules, including website_slides, mail, crm, website, product, account
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0
No-code setupYes, via Odoo Studio (Enterprise)
Alternativesemail, phone, CopyClipboardChar

What the URL widget does

The url widget makes char fields navigable. In readonly contexts, list cells, readonly forms, kanban cards, the value renders as an anchor with target="_blank", so following a link never navigates away from Odoo. In edit mode on forms, the form.url variant shows a plain text input with a globe icon beside it that opens the current value.

The href goes through one transformation, read directly from the source: if the value does not match an absolute http, https or ftp URL and does not start with a slash, http:// is prepended. Only the link is touched; the stored value and the displayed text stay exactly as typed. Note it is plain http://, not https://, the target site's redirect is expected to upgrade the connection.

Two lesser known controls complete the picture. The website_path option switches prefixing off, for app-internal paths like /my/orders. And a text attribute on the field element replaces the visible URL with any label you choose, turning https://partner-portal.example.com/download/4711 into Download specification.

What this means for your team

Records collect links: supplier portals, ticket trackers, shared drives, product datasheets. Rendered as text they get copied into browsers by hand; rendered with this widget they are one click, in a new tab, with the Odoo screen intact behind them. The productivity math is small per click and large per year.

The text attribute is the presentation upgrade most implementations miss. A list of tracking links reading Track shipment beats a column of 90-character carrier URLs both in readability and in column width. Because it is an attribute, the label can even be set once in the view while every row keeps its own destination.

One governance note: the widget stores whatever users type, valid or not. If broken links in customer-facing places would embarrass you, validation belongs on the model (a constraint) or at entry time, not in this widget, which by design does not check anything.

Setting it up in Odoo Studio (no code)

Studio documents this widget for Text fields.

  1. Open the view in Studio and select the field that holds the link (a Text field).

  2. In the Properties tab, set Widget to URL.

  3. Optionally set a Placeholder to show an example URL in the empty input.

  4. Click Close to leave Studio.

What Studio cannot do here

Studio sets the widget; the two refinements need XML. The text display label is an attribute, not a property Studio exposes, and website_path likewise is set in options by hand. Both are one-line view edits.

Supported options in Odoo 19

Verified against url_field.js in the Odoo 19.0 web module. The last row is not an option but an element attribute, read from extractProps (attrs.text); it appears in no options panel, which is exactly why it is worth knowing.

OptionTypeWhat it does
website_pathbooleanUses the value exactly as stored in the href, disabling the automatic http:// prefixing. Meant for app-internal paths and other values that must not be rewritten.(default: false)
placeholder_fieldfield nameReads the input's placeholder text from another char field on the record instead of a static placeholder attribute.(since Odoo 19.0)
textstring (attribute)Element attribute, not an option: replaces the displayed URL with fixed link text while the href keeps following the field value. Set it directly on the field element.

The prefix rule can surprise you. Values already carrying http, https, ftp or ftps schemes, and values starting with /, are linked unchanged; everything else gets http:// in front. A value like www.example.com:8080 therefore links fine, but example dot com becomes a dead link. The widget never validates.

Working examples

Basic link column

<field name="website" widget="url"/>

example.com is stored as typed and linked as http://example.com, opening in a new tab.

Friendly link text

<field name="datasheet_url" widget="url" text="Download datasheet"/>

Every row displays Download datasheet; each row's href is its own stored URL.

Internal path without prefixing

<field name="portal_path" widget="url"
       options="{'website_path': True}"/>

A value like /my/orders/42 is used exactly as stored. Without the option this specific value would also survive (leading slash), but the option makes intent explicit and protects values like page#section.

Placeholder from another field

<field name="landing_url" widget="url"
       options="{'placeholder_field': 'website'}"/>

The regex that decides your link

One line of source decides every href this widget emits: a regular expression testing for ftp(s)://, http(s):// or a leading slash. Match, and the value passes through; no match, and http:// is glued on. Three practical consequences follow.

Protocol-relative and anchor-only values break. //cdn.example.com/file starts with a slash, fine. But mailto: or tel: values do not match and get prefixed into garbage, use the email and phone widgets for those.

The upgrade to https is delegated. Prefixed links go out as http://; virtually every modern site redirects to https, but strict environments (HSTS-only intranets without port 80) can reject the first hop. Store full https URLs where that matters.

Readonly clicks are guarded. The anchor stops click propagation, so clicking a link in a list opens the link, not the record row, a small template detail (t-on-click.stop) that makes the widget usable in lists at all.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. No changes on the development branch beyond the framework port; see below.
Odoo 19.0VerifiedVerified against the shipped source, including the extractProps text attribute.
Odoo 18.0VerifiedIdentical except placeholder_field, which arrived in 19.0. Verified against the 18.0 source.

Upgrading from Odoo 18? One addition: placeholder_field did not exist in 18.0. The prefix regex, website_path, the text attribute and both registrations are identical between 18.0 and 19.0.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The changes below are read from the public development branch and are not final until release.

No option changes. website_path, placeholder_field, the text attribute and both the url and form.url registrations are unchanged; the component is ported to the new Owl props and signals system. XML carries over untouched; only JavaScript patches importing the class need review. We re-verify after release.

Common problems and fixes

SymptomCause and fix
Link opens http://https//example.com or similar garbageThe stored value contains a malformed scheme (https:/ with one slash, or a scheme the regex does not know), so the prefix was added on top. Fix the stored value to a proper https:// URL; the widget never repairs values.
Link text shows but clicking goes nowhere usefulThe value is not a URL at all; the widget linkified free text. Add validation on the model if the field must always contain working links.
Custom label ignoredtext was put inside options instead of on the element. It is an attribute: &lt;field ... widget="url" text="My label"/&gt;.
Internal path opens with http:// prefixedThe value lacks the leading slash, so the regex did not recognize it as a path. Store paths with a leading slash or set options="{'website_path': True}".
Clicking a list cell opens the record instead of the linkThe field is rendered without the widget, as plain char. Set widget="url"; its anchor stops the row click from firing.

URL widget vs the alternatives

WidgetBest forKey difference
urlWeb links stored on recordsNew-tab anchor with scheme prefixing, path mode and a hidden custom-text attribute
emailEmail addressesmailto link plus envelope action on forms
phonePhone numberstel link with whitespace-stripped href and SMS action
CopyClipboardCharValues users copy rather than openAdds a copy button, no linking

Pick by destination type: web page here, email for mailto, phone for tel. If the value is an image URL to display rather than a link to follow, that is the image_url widget's job, and if users mainly copy the value instead of opening it, CopyClipboardChar serves them better.

Frequently asked questions

How do I make a field a clickable link in Odoo?+
Set widget="url" on the char field in the view, or pick the URL widget in Studio. Readonly renders an anchor opening in a new tab; forms keep an editable input with a globe icon.
How do I show custom text instead of the URL?+
Add the text attribute to the field element: <field name="link" widget="url" text="Open portal"/>. It is an attribute rather than an option, and it changes only the display, never the destination.
Why do my links start with http:// and not https://?+
The source prefixes plain values with http:// literally, delegating the https upgrade to the target site's redirect. Store the full https:// URL when the first hop must be secure.
Can the link open in the same tab?+
Not with this widget; target="_blank" is hardcoded in both templates. Same-tab navigation needs a custom widget or a button with an act_url action.
Does Odoo validate that the value is a real URL?+
No. The input is a plain text input and the widget stores anything. Add a Python constraint if validity matters.
What is website_path for?+
It switches off the prefix logic so the stored value is used verbatim, intended for internal paths like /my/orders. Values with a leading slash are safe either way; the option covers everything else and documents intent.

Building a portal your customers actually use?

Link fields are the small end of web-connected Odoo. The big end is customer portals, document downloads, tracking pages and website integrations that pull live data from your database. We design and build those on Odoo's website framework and Next.js frontends alike.

Book a free consultation

How this page was produced

This page was verified by reading url_field.js and its QWeb templates in the Odoo 19.0 web module, including the href regex, the extractProps attribute handling and both registrations, with the same file compared on the 18.0 branch and the development branch. Studio steps follow Odoo's Studio documentation for Text field widgets. Spotted an error or a version difference? Tell us and we will correct the page.