statusbar_duration
statusbar_duration is the status bar that prints how long the record sat in every stage, fed by the chatter's tracking history. It only works on models that opt into a server-side mixin, and Odoo 20 rewrites its data contract.
| Technical name | statusbar_duration |
|---|---|
| Field types | many2one |
| Views | form |
| Module | mail |
| Used in core | 2 occurrences across 1 module: project task views, with crm and others consuming it through subclasses |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0 |
| No-code setup | No. Requires XML plus a server-side mixin |
| Alternatives | statusbar, rotting_statusbar_duration, state_selection |
What the Status with time widget does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
clickable | boolean | Inherited from statusbar. Whether clicking a stage button moves the record there; the click updates and saves immediately. Set it false when stages should only advance through workflow buttons.(default: true)(since Odoo 17.0) |
fold_field | field name | Inherited from statusbar. Boolean field on the stage model; stages with it set collapse into the trailing dropdown, mirroring folded kanban columns. Core passes 'fold' on project tasks.(since Odoo 17.0) |
statusbar_visible | attribute (comma list) | Field-element attribute, not an option: comma-separated values to show inline. The current stage is always displayed even when not listed. Inherited unchanged from the base widget.(since Odoo 17.0) |
The duration is not an option. There is no switch controlling the time display; it appears whenever the record's duration_tracking JSON has a positive value for a stage. An empty JSON, which is what models without the mixin return, simply renders a plain status bar.
Working examples
Where the durations come from
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | Partial / changed | Not released. Stored JSON in minutes, live ticking, new s/d keys; see below. |
| Odoo 19.0 | Verified | Verified against the shipped source; file identical to 17 and 18. |
| Odoo 18.0 | Verified | Same source as 19. No XML changes needed. |
| Odoo 17.0 | Verified | Widget and mixin introduced together in the mail module. |
| Odoo 16.0 | Not available | Neither the widget nor mail.tracking.duration.mixin exists. |
Upgrade note. The widget arrived in Odoo 17 together with the mixin; there is nothing to migrate from 16, where neither exists. From 17 through 19 the file is unchanged, so views carry over untouched. Watch the 20 upgrade closely though; the data contract changes underneath (see below).
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The status bar renders but no durations appear | The model does not use mail.tracking.duration.mixin, so duration_tracking is empty or absent. Inherit the mixin and set _track_duration_field to a tracked many2one on the model. |
| ValueError about the field needing to be Many2one with tracking=True | _track_duration_field names a selection or an untracked field; the mixin's compute refuses both. Point it at a many2one with tracking=True; both conditions are mandatory. |
| The current stage's time seems frozen | In Odoo 17 to 19 the value only covers completed intervals up to the last stage change. Expected behavior; the live-ticking current stage arrives with the Odoo 20 rework. |
| Durations changed after cleaning up the chatter | The 19 compute reads mail.tracking.value history; deleting tracked messages deletes the underlying intervals. Keep tracking messages on models where time in stage matters; the history is the data. |
| Widget crashes or misbehaves on a selection field | supportedTypes is narrowed to many2one; JSON keys are stage ids. Use the plain statusbar for selection fields; durations need a many2one. |
Status with time widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
statusbar_duration | Stage bars where time spent per stage should be visible inline | Adds chatter-computed durations to each stage button; requires the tracking duration mixin |
| statusbar | Standard stage navigation without time information | Same options and behavior, accepts selection fields too, no server-side requirements |
| rotting_statusbar_duration | Project and CRM records that should flag themselves when stale | Subclass of this widget that adds the rotting day-pill on top of the durations |
| state_selection | A compact per-record status bullet instead of a full stage bar | Dropdown bullet for three-state flags, no stage history or durations |
Frequently asked questions
What does the statusbar_duration widget do in Odoo?+
Why do no durations show on my custom model?+
Can I use statusbar_duration on a selection field?+
Where does Odoo store the time spent in each stage?+
Does the current stage's duration update in real time?+
Which core forms use statusbar_duration?+
Want to know where your pipeline loses days?
We wire time-in-stage tracking into your own models, tasks, tickets, orders, anything with stages, and build the dashboards that turn those durations into bottleneck answers. Odoo 16 to 19, including the mixin work the widget needs.
Get a pipeline review