Skip to main content
iVentureTeam

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.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 11, 2026Updated August 11, 20267 min read
Odoo 19 list view showing date fields rendered by the remaining_days widget as relative labels such as Today in bold red and In 3 days, instead of absolute dates.
Studio nameRemaining Days
Technical nameremaining_days
Field typesdate, datetime
Viewsform, list, kanban
Moduleweb, present in every Odoo database
Used in core26 occurrences across 14 modules, including project, certificate, l10n_in, stock, mail, project_todo
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupYes, via Odoo Studio (Enterprise): Date field, widget Remaining Days
Alternativesdate, datetime, daterange, mrp_remaining_days_unformatted

What the Remaining Days field does

Deadlines are questions, not data. When a user looks at an activity date, the question is never "what date is it", it is "how much time do I have". The Remaining Days widget answers that directly by rendering a date or datetime field as a relative phrase, computed against today in the user's timezone: In 3 days, Today, 2 days ago.

It is a read-oriented widget. In display mode you get the phrase plus color coding; the moment the field becomes editable, the component delegates to the standard date picker, which is why Odoo's own Studio documentation recommends setting the field to read only. Core uses it anywhere urgency matters more than the calendar date: project deadlines, activity dates, stock scheduled dates.

What this means for your team

The difference between a list showing 06/15/2026 and one showing Overdue by 2 days in red is the difference between a report and a to-do list. Relative dates remove a mental subtraction step from every row scan, and the color rules move the eye straight to trouble. On queues of any size, that is measurable time, and more importantly it is missed-deadline insurance.

The default thresholds encode a sane policy: red once overdue, orange on the due day, bold for both. If your process needs an earlier warning, amber at three days out for example, that is exactly what the widget's expression-based option allows, and it is a view-level change, not a development project.

One planning note: the widget goes absolute past 99 days. For long-horizon dates like contract renewals, users will see a plain date again, which is usually the right call but surprises teams who expected In 8 months.

Setting it up in Odoo Studio (no code)

This widget has a first-class, documented Studio path. Odoo Studio is available on Enterprise plans.

  1. Open the form or list you want to change and click Studio in the top menu.

  2. Drag a Date or Date & Time field onto the view, or select an existing one.

  3. In the Properties tab, set Widget to Remaining Days.

  4. Enable Read only. The official documentation recommends it, because in edit mode the widget shows a plain date picker and the relative label disappears.

Tip: pair it with a Conditional visibility rule if the date only matters in some states, for example hiding a deadline once a task is done, so the red overdue label does not linger on finished work.

What Studio cannot do here

Studio sets the widget; it does not reach the color logic. Two frequent requests need view XML.

Changing the thresholds, such as turning the label orange three days before the deadline instead of on the day, means passing the classes option with your own expressions, shown in the examples below. Studio has no interface for it.

Changing what counts as urgent per record type, for example different warning windows for invoices and deliveries, means different options per view, and sometimes a computed field feeding the date. Both are quick jobs for someone fluent in Odoo views, and the kind of small change we ship as Odoo customization work.

Supported options in Odoo 19

Verified against remaining_days_field.js in the Odoo 19.0 web module. The widget declares no supportedOptions block at all; the single option below exists only in extractProps, which is exactly the kind of gap between documentation and source this project exists to record.

OptionTypeWhat it does
classesobject (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

Standard usage

<field name="date_deadline" widget="remaining_days"/>

Defaults apply: bold at zero days or less, red when negative, orange at exactly zero.

Custom warning window: orange from three days out

<field name="date_deadline"
       widget="remaining_days"
       options="{'classes': {'danger': 'days < 0', 'warning': 'days >= 0 and days <= 3', 'bf': 'days <= 3'}}"/>

Your dictionary replaces the default one, so restate every rule you want to keep.

Muted instead of alarming, for informational dates

<field name="next_review_date"
       widget="remaining_days"
       options="{'classes': {'muted': 'True'}}"/>

Every value renders gray: relative convenience without the urgency theater.

The 30-day and 99-day thresholds, and the archived-record rule

The display logic has three tiers, all read from the source.

Within 30 days either way, the label always counts in days: In 28 days, never In 4 weeks. The code forces the day unit below that threshold to avoid vague phrasing.

Between 31 and 99 days, it hands off to the browser's relative calendar formatting, so you may see Next month or In 3 months, capitalized by the widget.

Past 99 days in either direction, it gives up on relative phrasing entirely and shows the normal formatted date. There is no option to change this cutoff in Odoo 19.

Two more rules matter in practice. Archived records are exempt from coloring: the source checks the record's active state and returns no classes at all, so an overdue date on an archived record renders plain, which is deliberate noise reduction. And the day difference is computed on calendar days, both sides truncated to the start of day, so a datetime due at 23:59 tonight is Today all day, not In 10 hours.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. The development branch renames the widget to relative_date and rebuilds the display algorithm; see below.
Odoo 19.0VerifiedVerified against the shipped source: thresholds, classes option and archived-record rule.
Odoo 18.0VerifiedSame classes option, types and registration, verified in the 18.0 source.
Odoo 17.0VerifiedWidget present with the same registry name. Not re-verified line by line for this page.
Odoo 16.0VerifiedWidget 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

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. What follows is read from the public development branch, which is unstable until feature freeze; we re-verify this page against the shipped release.

The widget is renamed. On the development branch the remaining_days directory, template and registration are gone, replaced by relative_date. The registry name changes with it, and at the time of writing no remaining_days alias is registered in the new file, which would make this a breaking rename for views that reference the widget by name. The display name, supported types and the classes option survive unchanged.

The algorithm is rebuilt. The flat 99-day cutoff and the 30-day day-unit rule are replaced by a graded unit table: within a week it counts days, within a month it counts weeks, within a year months, beyond that years, with an explicit calendar-boundary guard so month arithmetic does not misfire around month ends. Expect In 4 weeks and In 3 years where 19 showed a formatted date.

If your views use remaining_days, budget a find-and-replace to relative_date in your Odoo 20 upgrade checklist, pending what ships in September.

Common problems and fixes

SymptomCause and fix
Shows a plain date instead of In X daysThe 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 recordsThose 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 defaultsThe classes option replaces the default dictionary rather than merging into it. Restate the default rules alongside your own in the option.
Label disappears when editingEdit 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 hoursThe 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 branchThe 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

WidgetBest forKey difference
remaining_daysDeadlines and due dates where urgency is the pointRelative phrasing with expression-driven colors; absolute date past 99 days
dateEditable dates where the calendar value is the dataAbsolute display, always editable inline
datetimeTimestamps where the hour mattersShows the full date and time; no relative phrasing or urgency colors
daterangeStart and end presented as one periodBinds two fields into a single range control
mrp_remaining_days_unformattedManufacturing screens needing the raw day countMRP variant without the standard formatting

The test: if the user's question is "how long until", use this widget. If the question is "which date exactly", or the field must stay editable inline, use the standard date widgets.

Frequently asked questions

What does the remaining_days widget do in Odoo?+
It renders a date or datetime field as a relative label computed against today: Today, In 3 days, 2 days ago. By default it turns bold once the date is reached, red when overdue and orange on the due day, and past 99 days in either direction it shows the normal formatted date instead.
Can I change when the date turns red or orange?+
Yes, with the undocumented classes option: a dictionary mapping decoration names to expressions over a days variable, for example {'warning': 'days <= 3'} for an earlier amber warning. Your dictionary replaces the defaults, so restate any default rule you want to keep. There is no Studio interface for this.
How do I set up Remaining Days in Odoo Studio?+
Add or select a Date or Date & Time field, set its Widget to Remaining Days in the Properties tab, and enable Read only, which the official documentation recommends because the relative label only exists in display mode.
Why does the field show a normal date for far-future deadlines?+
The Odoo 19 source switches to absolute formatting once the difference exceeds 99 days in either direction, and always counts in plain days inside 30 days. Between those bounds you get calendar phrasing like Next month. None of these thresholds is configurable in 19.
Why do archived records show no urgency colors?+
Deliberate behavior read from the source: for records whose active flag is off, the widget skips the decoration logic entirely, so archived work does not scream overdue from inside filtered views.
Is remaining_days really being renamed in Odoo 20?+
On the public development branch, yes: the widget lives in a new relative_date directory, registers as relative_date, and at the time of writing no remaining_days alias exists, which would break views that use the old name. The display algorithm also changes to graded units, weeks then months then years. Odoo 20 ships around late September 2026, and we re-verify this page against the release.
Does remaining_days work on both date and datetime fields?+
Yes, the declared supported types are exactly date and datetime. For datetimes the comparison truncates both sides to the start of the day, so anything due later today reads Today, never In 6 hours.

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

How this page was produced

Behavior on this page was read from remaining_days_field.js in the Odoo 19.0 web module: the thresholds, the classes evaluation, and the archived-record exemption are all visible in that one file. The Odoo 18 source was compared for the version table, and the rename to relative_date was verified by diffing the 19.0 branch against the public development branch, where the old directory no longer exists. The Studio steps follow the official Studio documentation for this widget. Spotted an error? Tell us and we will correct the page.