image_url
image_url renders a plain char field as an image, fetched by the browser straight from the URL it contains. Nothing is downloaded or stored server side, which is exactly its power and its caveat.
| Studio name | Image (on Text fields) |
|---|---|
| Technical name | image_url |
| Field types | char |
| Views | form, list, kanban |
| Module | web, present in every Odoo database |
| Used in core | 4 occurrences across 2 modules: mail (link preview thumbnails), website |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | Yes. In Studio, set a Text field's widget to Image. |
| Alternatives | image, background_image, url |
What the Image URL widget does
What this means for your team
Setting it up in Odoo Studio (no code)
What Studio cannot do here
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
size | array [width, height] | Bounds the rendered image. Studio offers small [0,90], medium [0,180] and large [0,270], but any [w,h] array works in XML. When set, the width and height attributes are ignored. The preset zero widths are treated as unset, so presets cap height only. |
width (attribute) | integer | XML attribute fallback for the max width in pixels, only read when the size option is absent. |
height (attribute) | integer | XML attribute fallback for the max height in pixels, only read when the size option is absent. |
The size presets store a zero width ([0, 90] and friends), which the style getter treats as unset, so presets effectively cap only the height. Exact widths therefore require the attribute path, and the attribute path requires not using size at all.
Working examples
Fallback mechanics, dead code and the 19 sizing tweak
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Mechanical framework changes only in the development branch; see below. |
| Odoo 19.0 | Verified | Verified against the shipped source; adds width and height auto for unset sides. |
| Odoo 18.0 | Verified | Same option and attributes; style emitted only for provided bounds. |
| Odoo 17.0 | Verified | Same behavior as 18.0. |
| Odoo 16.0 | Verified | Same option, attributes and precedence, verified in the 16.0 source. |
XML is portable from 16 through 19. Recheck any CSS that sized these images externally when moving to 19, because the widget now emits width and height auto for unset sides.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The field shows a gray placeholder instead of the image | The browser could not load the URL: dead link, host blocking hotlinks, mixed content (http image on an https page) or a non image response. Open the URL directly in a browser tab; fix the link or host the asset somewhere reliable. |
| width and height attributes are ignored | The size option is set, and it takes precedence over both attributes in extractProps. Remove the size option when you need exact attribute bounds. |
| Images are tiny even with size medium | Sizing is max based; a small source image is never upscaled. Serve larger source images; the widget will not stretch pixels. |
| Thumbnails shifted after upgrading to 19 | The 19 style getter emits width auto and height auto for unset sides, overriding external CSS that sized the img element. Set explicit bounds via the option or attributes, or adapt the CSS to target the wrapper. |
Image URL widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
image_url | Showing images hosted elsewhere from a URL kept in a char field | Renders by reference, stores no binary, falls back to a placeholder on load failure |
| image | Images stored in Odoo with upload and resize pipeline | Binary field with attachments, WebP variants and editing; heavier but self contained |
| background_image | Record images as CSS backgrounds | Binary based descriptor rendering a background instead of an img element |
| url | Showing the link itself as clickable text | Renders an anchor, not the image behind it |
Frequently asked questions
What does the image_url widget do in Odoo?+
Does image_url download or cache the image in Odoo?+
How do I control the displayed size?+
Can users upload an image with this widget?+
Is image_url available in Studio?+
Product images from your PIM, live in Odoo
Rendering catalogs by URL saves gigabytes, until hotlink blocks and dead CDNs fill your views with gray placeholders. We design image pipelines for Odoo, choosing per field between URL rendering and stored attachments, with fallbacks that hold up.
Sort out my product images