relative_date
New in Odoo 20 and the direct replacement for remaining_days. It fixes a real annoyance in the old widget: a date three weeks away no longer reads as "next month".
September 18, 2026Updated September 18, 20264 min read
| Technical name | relative_date |
|---|---|
| Field types | date, datetime |
| Views | form, list, kanban, card |
| Module | web, present in every Odoo 20 database |
| Used in core | 38 uses across Odoo 20 Community and Enterprise views, excluding tests. Does not exist in Odoo 19. |
| Versions | Odoo 20.0 |
| No-code setup | No Studio entry of its own, though it keeps the Remaining Days display name the old widget used. |
| Alternatives | remaining_days, date, datetime, daterange |
What the relative_date widget does
What this means for your team
Supported options in Odoo 20
| Option | Type | What it does |
|---|---|---|
classes | dictionary of class to expression | <strong>Undocumented: not declared in supportedOptions.</strong> Maps a CSS decoration to a Python expression evaluated with <code>days</code>, the signed distance in days, and the record in scope. The component's default bolds anything already due. Carried over unchanged from the Odoo 19 remaining_days widget.(default: {'bf': 'days <= 0'})(since Odoo 20.0) |
classes is read in extractProps and evaluated against a context containing days and the record, so you can style the value conditionally on how far away the date is. The component ships a default of { bf: "days <= 0" }, which bolds anything already due.
Working examples
The month-boundary guard, and why it exists
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 19.0 | Not available | Does not exist. The equivalent widget is remaining_days. |
| Odoo 20.0 | Verified | Introduced in Odoo 20. Verified against the shipped 20.0 source. |
This widget does not exist before Odoo 20.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| A view using remaining_days stopped rendering relative dates after upgrading | remaining_days was removed in Odoo 20 with no alias. Change the widget to relative_date. The classes option carries over unchanged. |
| The classes option does not appear in Studio | It is undeclared. The widget has no supportedOptions at all. Set it in the view XML. It works despite being undocumented. |
| Dates near a month boundary read oddly | They should not, and that is the point of verifyCalendarBoundary. If they do, the widget is not the one rendering them. Confirm the field is actually using relative_date rather than falling back to its default widget. |
| Studio still shows the name Remaining Days | The new widget deliberately keeps that displayName. Expected. Check the XML to confirm which widget is in use. |
Relative_date widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
relative_date | Triage screens where how soon matters more than exactly when | Explicit unit thresholds plus a month-boundary guard, new in Odoo 20 |
| remaining_days | The same job on Odoo 19 | Removed in Odoo 20 with no alias; vaguer unit selection |
| date | The exact date | Absolute rather than relative |
| datetime | An exact date and time | Absolute, with time of day |
| daterange | A start and end pair | Two dates rather than a distance |
Frequently asked questions
What replaced remaining_days in Odoo 20?+
Does relative_date have any options?+
Why does Odoo 20 show 'In 4 weeks' where Odoo 19 said 'next month'?+
Why does Studio still call it Remaining Days?+
Date widgets that vanish in an Odoo 20 upgrade?
remaining_days is one of sixty-two registrations Odoo 20 removed, and it leaves no alias behind to warn you. We diff your views against the 20.0 branch and hand you the exact list of widget names to change.
Get an upgrade audit