remaining_days
The widget behind every Today, In 3 days and 2 days ago in Odoo. One undocumented option controls the colors, and Odoo 20 renames the whole widget.
| Studio name | Remaining Days |
|---|---|
| Technical name | remaining_days |
| Field types | date, datetime |
| Views | form, list, kanban |
| Module | web, present in every Odoo database |
| Used in core | 26 occurrences across 14 modules, including project, certificate, l10n_in, stock, mail, project_todo |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | Yes, via Odoo Studio (Enterprise): Date field, widget Remaining Days |
| Alternatives | date, datetime, daterange, mrp_remaining_days_unformatted |
What the Remaining Days field 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 |
|---|---|---|
classes | object (decoration: expression) | Maps Bootstrap decoration names to expressions evaluated with a days variable (floored day difference) and the record's fields. Replaces the default dictionary entirely. Declared nowhere; read only in extractProps.(default: {'bf': 'days <= 0', 'danger': 'days < 0', 'warning': 'days == 0'}) |
The expressions run over a days variable, the floored day difference between the field and today, with the record's fields also available in context. Keys are Bootstrap decoration names (danger, warning, info, muted, bf for bold, it for italic), the same vocabulary as list-view decorations.
Working examples
The 30-day and 99-day thresholds, and the archived-record rule
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. The development branch renames the widget to relative_date and rebuilds the display algorithm; see below. |
| Odoo 19.0 | Verified | Verified against the shipped source: thresholds, classes option and archived-record rule. |
| Odoo 18.0 | Verified | Same classes option, types and registration, verified in the 18.0 source. |
| Odoo 17.0 | Verified | Widget present with the same registry name. Not re-verified line by line for this page. |
| Odoo 16.0 | Verified | Widget present with the same registry name. Not re-verified line by line for this page. |
Upgrade note. Views written for 16 through 18 carry over unchanged to 19: same registry name, same hidden classes option, same thresholds. The move to watch is Odoo 20, where the widget itself is renamed; plan view updates during an Odoo migration rather than after the upgrade surprises you.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Shows a plain date instead of In X days | The date is more than 99 days away in either direction; the widget switches to absolute formatting there. Expected behavior in 19, with no option to change the cutoff. Odoo 20's rebuild grades units instead. |
| No colors on some records | Those records are archived; the source skips all decoration for inactive records. Expected. Unarchive the record if it genuinely still carries a live deadline. |
| My custom classes killed the bold and red defaults | The classes option replaces the default dictionary rather than merging into it. Restate the default rules alongside your own in the option. |
| Label disappears when editing | Edit mode renders the standard date picker; the relative label is display-only. Set the field read only where the label matters, as the Studio docs recommend. |
| Today shown for something due in a few hours | The diff is computed on calendar days, both sides truncated to start of day. Expected for datetimes; show the time separately if hours matter. |
| Views broken after moving to the Odoo 20 development branch | The widget was renamed to relative_date and the old name is not registered. Replace widget="remaining_days" with widget="relative_date", and re-check after the final release. |
Remaining Days field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
remaining_days | Deadlines and due dates where urgency is the point | Relative phrasing with expression-driven colors; absolute date past 99 days |
date | Editable dates where the calendar value is the data | Absolute display, always editable inline |
datetime | Timestamps where the hour matters | Shows the full date and time; no relative phrasing or urgency colors |
daterange | Start and end presented as one period | Binds two fields into a single range control |
mrp_remaining_days_unformatted | Manufacturing screens needing the raw day count | MRP variant without the standard formatting |
Frequently asked questions
What does the remaining_days widget do in Odoo?+
Can I change when the date turns red or orange?+
How do I set up Remaining Days in Odoo Studio?+
Why does the field show a normal date for far-future deadlines?+
Why do archived records show no urgency colors?+
Is remaining_days really being renamed in Odoo 20?+
Does remaining_days work on both date and datetime fields?+
Deadlines slipping through your views?
Custom warning windows, per-team urgency rules, and views that surface overdue work before it costs money: all built on the options this page documents. We tune Odoo views for operations teams on 16 through 19, with Odoo 20 rename checks included in every migration.
Book a free consultation