Skip to main content
iVentureTeam

website_redirect_button

The website redirect button turns the is_published flag into a header button that reads Published or Unpublished and jumps straight to the record's public page.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 16, 2026Updated August 16, 20265 min read
Technical namewebsite_redirect_button
Field typesboolean
Viewsform
Modulewebsite
Used in core11 occurrences across 10 modules, including website_slides, website_sale, website_partner, website_event_track, test_website, website_event
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupNo. The widget depends on a server method, so it is set in XML by a developer.
Alternativesboolean_toggle, url, Default boolean checkbox

What the website redirect button does

Models that can appear on the Odoo website, such as products, courses, events and job positions, carry an is_published boolean from website.published.mixin. Rendered plainly, that field is just a checkbox. The website_redirect_button widget renders it as a status button in the form header instead: it reads Published when the flag is true and Unpublished when it is false.

The part that surprises people is the click behavior. The button does not toggle publication. It fires the record's open_website_url method through the standard view-button machinery, which redirects the browser to the record's public page. In other words, it is a labeled shortcut from the backend form to the frontend page, with the publish state as its caption.

What this means for your team

For teams that manage content in the backend, the constant question is "what does this actually look like on the site?" This widget answers it in one click from the form header, without hunting for the URL or switching to the website editor first.

The label doubles as a status check. An editor reviewing a batch of products or course pages can see at a glance which records are live before jumping to them. Because clicking never changes the publish state, there is no risk of accidentally unpublishing something while checking it, which is exactly the mistake a raw boolean toggle in the header would invite.

If your own model should appear on the website, the practical takeaway is that this widget is the visible end of a larger pattern: inherit website.published.mixin, and the field, the URL computation and the redirect method all come with it.

Working examples

The core pattern, from website_sale

<span id="button_website" position="before">
    <field name="is_published"
           widget="website_redirect_button"
           invisible="not sale_ok"/>
</span>

This is how the product form shows its Published button only for saleable products. The field sits in the form header area, which is where the button styling belongs.

On your own website-published model

# Python: the mixin provides is_published and open_website_url
class LibraryBook(models.Model):
    _name = "library.book"
    _inherit = ["website.published.mixin"]
<header>
    <field name="is_published" widget="website_redirect_button"/>
</header>

Without the mixin, or at least a working open_website_url method and a website_url compute, the button renders but the click fails on the missing method.

A field that behaves like a smart button

The component is 28 lines, and all of its behavior comes from delegation. The label is a getter that reads the field value and returns one of two translated strings. The click handler calls this.env.onClickViewButton with type: "object" and name: "open_website_url", passing the record's context, eval context, model and ids, exactly as if you had declared a <button type="object"/> in the view.

That delegation has a practical consequence: everything a normal object button does still happens. Unsaved changes prompt the usual save flow, access rights on the method are checked server side, and the returned action, normally an ir.actions.act_url pointing at website_url, is executed by the action service. The widget is best understood as a field-shaped wrapper around a standard smart button.

Note the asymmetry with the neighboring Go to Website button that many of these forms also have: that button is a plain view button, while this widget adds the live Published or Unpublished caption on top of the same redirect.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. The development branch adds a Scheduled label driven by publish_on; details below.
Odoo 19.0VerifiedVerified against the shipped source.
Odoo 18.0VerifiedByte-identical component apart from the removed module pragma.
Odoo 17.0VerifiedSame two-label behavior and open_website_url delegation.
Odoo 16.0VerifiedSame behavior; the widget has been stable across versions.

Upgrade note. The component is byte-identical between Odoo 18 and 19 apart from the removed module pragma, so views migrate with no changes. Anything you customized on open_website_url server side carries the behavior, not the widget.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The notes below are read from the public development branch, which is unstable and can change until feature freeze. We re-verify this page against the shipped release.

The development branch adds a third state to the label: when the record has a truthy publish_on field, the button reads Scheduled instead of Published or Unpublished. That lines up with scheduled publishing landing in the website stack, and it means the widget will report three states from the same boolean field plus the new date.

Internally, the click handler moves from env.onClickViewButton to the new useViewButtonHandler hook. Behavior is unchanged, but a JavaScript patch that overrode onClick will need a fresh look after the release.

Common problems and fixes

SymptomCause and fix
Clicking the button throws a missing method errorThe model does not implement open_website_url, usually because it does not inherit website.published.mixin. Inherit website.published.mixin on the model, or implement open_website_url returning an act_url action.
The button renders as a plain checkboxThe widget attribute is missing or misspelled, so the default boolean widget is used. Set widget="website_redirect_button" on the field. The name is all lowercase with underscores.
Button says Unpublished but the page is liveThe button reads is_published on the current record only. Multi-website setups publish per website. Check the record's website-specific publish state and which website you are previewing.
Clicking does not toggle publicationBy design. The click opens the website page and never writes the field. Toggle publication from the frontend edit bar or expose the boolean separately in the backend.
The button looks unstyled in the middle of the formThe widget is designed for the form header button area. Place the field inside the header, as core views do, for correct button styling.

Website redirect button vs the alternatives

WidgetBest forKey difference
website_redirect_buttonJumping from a backend record to its public page while seeing the publish stateRead-only caption; the click navigates, it never toggles
boolean_toggleActually flipping a publish flag from list or form viewsWrites the field immediately and navigates nowhere
urlShowing a stored URL as a clickable linkRenders a char field as a plain hyperlink with no state caption
Default boolean checkboxSimple on-off flags inside the form bodyEditable checkbox with no navigation

The rule of thumb: this widget is for jumping to the page while reading the state. If users need to change the publish state from the backend form, give them the plain boolean or a toggle, because this button will never do it.

Frequently asked questions

What does the website_redirect_button widget do in Odoo?+
It renders a boolean publish field, normally is_published, as a form header button that reads Published or Unpublished, and clicking it calls the record's open_website_url method to open the record's page on the website.
Does clicking the button publish or unpublish the record?+
No. The click only navigates to the public page. Publication itself is toggled from the website frontend or by writing the boolean elsewhere. This separation is deliberate, so checking a page can never accidentally unpublish it.
Can I use website_redirect_button on my custom model?+
Yes, as long as the model provides what the widget calls: an is_published style boolean and an open_website_url method. Inheriting website.published.mixin provides both, plus the website_url compute the method relies on.
Does the widget have any options?+
No. Verified against the Odoo 19 source, the registration passes only the component and the code reads no options. Labels and the target method are hardcoded.
What changes for this widget in Odoo 20?+
The development branch adds a Scheduled label when the record's publish_on date is set, alongside an internal refactor of the click handler. Nothing is final until Odoo 20 ships in late September 2026, and we re-verify after release.

Publishing workflow not quite fitting?

Scheduled go-lives, per-website publication rules, approval steps before a page goes public: the built-in publish button is only the surface. We build website-enabled Odoo models and publishing workflows that match how your content team actually works.

Talk to an Odoo website expert

How this page was produced

This page was verified by reading addons/website/static/src/components/fields/redirect_field.js on the Odoo 19.0 branch, comparing it against the 18.0 branch and the development branch, and checking real usages such as the website_sale product form XML. The widget's zero-option surface is a statement about the source, not an omission. Spotted something we missed? Tell us and we will correct the page.