website_publish_button
The Published smart button that turns into red Unpublish when you hover it is two parts: a server method and this widget. website_publish_button renders the label; it toggles nothing itself.
August 25, 2026Updated August 25, 20265 min read
| Technical name | website_publish_button |
|---|---|
| Field types | boolean |
| Views | form (inside stat buttons) |
| Module | website |
| Used in core | 2 occurrences across 2 modules: website_sale, website_profile |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. Added in view XML inside a stat button |
| Alternatives | website_redirect_button, boolean_toggle, boolean |
What the publish button field does
What this means for your team
Working examples
One name, two things: widget vs mixin method
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Development branch shows template cosmetics only; see below. |
| Odoo 19.0 | Verified | Verified against the shipped source. |
| Odoo 18.0 | Verified | Same behavior and markup. |
| Odoo 17.0 | Verified | Same behavior; labels moved from inline translation calls to template variables. |
| Odoo 16.0 | Verified | Same behavior on the legacy props API. |
Upgrade note. Views carry over unchanged from 16 through 19. In 16 the labels were translated inline in the template; since 17 they are template variables, invisible to XML but relevant if you had patched the template for wording.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Clicking the button does nothing | The field was placed without a wrapping type="object" button; the widget itself has no click handler. Wrap it in <button name="website_publish_button" type="object"> as core does. |
| AccessError when some users click | The mixin's write checks publishing rights server side; the widget never disables itself client side. Grant the publishing right, or hide the button with groups= for viewer roles. |
| Label renders as plain text without colors or hover flip | The widget sits outside a stat button, so the o_stat_info hover CSS never applies. Place it inside a button with class oe_stat_button in the form's button box. |
| Widget shows Unpublished but the page is live | The field bound is not the one the website checks; is_published vs website_published mismatches on custom models. Bind the widget to the same field the mixin computes, is_published. |
| Missing widget warning in the console | The website module is not installed in this database; the registration lives there. Install website, or drop the widget on non-website databases. |
Publish button field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
website_publish_button | The Published / Unpublish stat button on forms of website-published records | Pure two-state label with a CSS hover flip; the wrapping button's method does the toggle |
| website_redirect_button | Jumping from the form to the record's live website page | Its click opens the website URL and never changes the publish state |
| boolean_toggle | Flipping a boolean inline, especially in list views | An editable switch that writes the field directly, no server method involved |
| boolean | A plain checkbox rendering of the published flag | No state wording, no hover action, no button-box styling |
Frequently asked questions
Why does the button say Published normally but Unpublish when I hover?+
Where is the actual publish logic?+
How do I add this to my own model?+
Why do products use a different publish toggle?+
Can unpublished users see the button?+
Publishing to your store still feels riskier than it should?
Clean publish workflows, staged product launches and page visibility rules are bread and butter of our Odoo eCommerce work. We build storefronts where what is live is always one glance, and one deliberate click, away.
Book a free consultation