Skip to main content
iVentureTeam

page_url

The address bar for a website page. It hides the leading slash while you type, puts it back when saving, and nudges the server to show you what a rename would break before you commit.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated September 2, 20266 min read
Technical namepage_url
Field typeschar
Viewsform
Modulewebsite, the Website builder
Used in core1 occurrence, the page list and form in website
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupNo. It depends on website-specific dependency and redirect handling
Alternativesurl, char, website_publish_button, image_radio

What the page URL field does

Changing a page's address on a live website is one of the few edits that can break things outside the system: existing links, bookmarks, search engine results. Odoo's answer is to show the consequences while you are still typing rather than after you have saved.

This widget is that field. It renders the site prefix beside the input so the address reads as a whole, hides the leading slash so what you edit is just the path, and adds it back before the value is stored, because the underlying field cannot be empty.

The more useful half is what it triggers. Typing fires a change event on a short delay, which lets the server recompute the page's dependencies and offer a redirect. So by the time you save, the form has already told you what points at this page and whether the old address will keep working.

What this means for your team

Page renames are cheap to do and expensive to get wrong, and the cost lands on marketing rather than on the person who made the change. Surfacing dependencies at the moment of editing is the only intervention that reliably works, because it is the only one that happens before the decision.

The redirect offer matters just as much. A renamed page with no redirect loses whatever authority the old address had accumulated, and the people who notice are not the people who made the change. Having that offered inline, rather than as a separate configuration screen, is what makes it get used.

The practical advice for a site with traffic worth protecting is to treat this field as a decision point rather than a text box: read what the form tells you before saving, and take the redirect.

Supported options in Odoo 19

The widget declares no options of its own. It spreads the link field's descriptor and sets one of its props to a different default, so the option list below is inherited. Read from the website module's field components and the URL field, Odoo 19.0.

OptionTypeWhat it does
website_pathbooleanInherited from the link field, but defaulted to true by this widget. Renders the address as a site-relative path with the site prefix beside it rather than as a full external link.(default: true here)
placeholderstring (attribute)Inherited from the link field. Hint text shown while the field is empty.

The website path behavior is on by default here. The link field can render either a full external link or a site-relative path, and this widget defaults to the path form, which is what makes the site prefix appear beside the input rather than being typed.

Working examples

The core usage

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

No options. The prefix, the dependency panel and the redirect offer all come from the widget and its companion component.

What is stored

# typed:  contact-us
# stored: /contact-us

The leading slash is stripped for display and re-added before storage, so the field is never empty.

The plain link field

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

Site-relative rendering without the dependency panel or the typing nudge.

A getter that writes, and a synthetic change event

Two implementation details in this widget are worth knowing, and both are unusual enough that they have survived into the development branch unchanged.

The first is how the slash is handled. The value getter strips a leading slash for display and then, in the same getter, writes the slash-prefixed value back into the record's data before returning the stripped one. Writing to the record from inside a getter is not how Odoo normally does things, and the source comment explains the constraint it works around: the field is required, so an empty string is not acceptable, and the user must be able to clear the path down to nothing while typing.

The second is the typing nudge. An effect attaches an input listener that, on a short debounce, compares the current value with the original and dispatches a synthetic change event when that comparison flips. That is what makes the server recompute dependencies and redirect options while the user types rather than on blur. The comment above it says outright that this should be handled more automatically by the framework, which is a candid marker of a workaround.

There is a small detail inside that listener: before dispatching, it temporarily prefixes a slash if the value has none, then restores what the user typed. So the server always sees a well-formed path even mid-edit.

Everything else, including the site prefix rendering and the link behavior, comes from the link field it extends, with the website path option defaulted on.

Version compatibility

VersionStatusNotes
Odoo 20.0Partial / changedNot released. Adds a translation button; the slash handling and typing nudge are unchanged.
Odoo 19.0VerifiedVerified against the shipped source.
Odoo 18.0VerifiedSame behavior.
Odoo 17.0VerifiedSame behavior with older component conventions.
Odoo 16.0VerifiedSame behavior with older component conventions.

Upgrade note. The widget has been present with this shape since Odoo 16 and needs no view change. What has moved around it is the surrounding page management, so a customization of the dependency panel is more likely to need attention than the field itself.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable and this may still change; we re-verify the page after release.

One addition. A translation button joins the field's components, so a multilingual site can edit the address per language from the same place. The slash handling, including the write from inside the getter, and the typing nudge are unchanged.

The rest of the diff is the migration to the new props and reference helpers, which reshapes how the input listener is attached without changing what it does.

Common problems and fixes

SymptomCause and fix
The dependency panel does not update while typingThe synthetic change event only fires when the changed state flips, and it is debounced. Pause briefly after typing; the recompute follows shortly.
The saved address has a double slashA leading slash was typed as well as the one the widget adds. Type the path without a leading slash; the widget supplies it.
The field will not accept an empty valueThe underlying field is required, which is exactly why the widget re-adds a slash. Expected. A page needs an address.
No redirect is offered on renameThe server decides that from the recomputed state, which needs the change event to have fired. Wait for the panel to update before saving.
The site prefix is missingThe website path behavior was turned off in an inherited view. Leave the inherited option at its default for this widget.
Missing widget errorThe website module is not installed in that database. Install Website, or use the plain link field.

Page URL field vs the alternatives

WidgetBest forKey difference
page_urlEditing a website page address with its consequences visibleHides and restores the leading slash, and nudges the server to recompute dependencies while you type
urlAny link, including site-relative pathsNo dependency panel and no typing nudge
charA plain text valueNo link rendering at all
website_publish_buttonPublishing state on a website recordA toggle rather than an address
image_radioChoosing a page layout visuallyA picture picker, unrelated to addresses

Use the plain link field with its website path option wherever you want site-relative editing without the dependency panel. For an address that is not a page, such as an external link on a record, the ordinary link field is correct and this widget's page-specific behavior would be misleading.

Frequently asked questions

Why does the field not show a leading slash?+
It is stripped for display so you edit only the path, and re-added before storage because the underlying field is required and cannot be empty.
Why do dependencies appear while I type?+
The widget dispatches a synthetic change event on a short debounce, which makes the server recompute the page's dependencies and redirect options before you save.
Is writing to the record from a getter normal?+
No, and the source acknowledges the constraint it works around. It is how the required field keeps a valid value while the visible input can be cleared, and it survives into the development branch unchanged.
Does it support the link field's options?+
Yes, since it spreads that descriptor. The one difference is that the website path behavior is defaulted on here.
What changes in Odoo 20?+
A translation button joins the field, so a multilingual site can edit the address per language. Everything else about the behavior is the same.

Renaming pages without losing the traffic

URLs, redirects and internal links are the part of a website migration that decides whether your rankings survive it. We plan and execute Odoo website structure changes, on versions 16 through 19.

Book a free consultation

How this page was produced

The slash stripping and the write from inside the getter, the debounced synthetic change event with its source comments, and the default for the website path prop were read from the website module's field components file on the Odoo 19.0 branch, with the inherited behavior read from the URL field in web. The usage comes from website/views/website_pages_views.xml. Version coverage comes from comparing the same file across the 16.0, 17.0 and 18.0 branches and against the public development branch. Spotted an error? Tell us and we will correct the page.