formatted_date
New in Odoo 19, formatted_date is a display-only date widget with per-view format control: month names instead of numbers, conditional colors from record data, and the label Indefinite when the date is empty.
| Technical name | formatted_date |
|---|---|
| Field types | date |
| Views | list, form (read-only display) |
| Module | hr_skills (Employee Skills) |
| Used in core | 6 occurrences across 1 module: the certification date columns in hr_skills |
| Versions | Odoo 20.0, Odoo 19.0 |
| No-code setup | No: the format and color options are XML only |
| Alternatives | date, remaining_days, daterange |
What the Formatted Date widget does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
day_format | string | How the day renders: numeric (2) or 2-digit (02). Passed straight to the browser's date formatting, so the output respects the user's language.(default: numeric)(since Odoo 19.0) |
month_format | string | How the month renders: numeric, 2-digit, long (March), short (Mar) or narrow (M). Core's certification columns use short.(default: numeric)(since Odoo 19.0) |
year_format | string | How the year renders: numeric (2026) or 2-digit (26).(default: numeric)(since Odoo 19.0) |
color | object | Mapping of Bootstrap color suffixes to Python expressions evaluated against the record, e.g. {'danger': 'is_expired'}. The first truthy expression applies its text-<color> class to the label.(default: {})(since Odoo 19.0) |
The format values are browser date-part tokens. day_format accepts numeric or 2-digit; month_format accepts numeric, 2-digit, long, short or narrow; year_format accepts numeric or 2-digit. There is no way to drop a part entirely: all three parts always render, so a month-and-year-only label is not achievable with options alone.
Working examples
Color expressions and the Indefinite label
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. The source file on the development branch is byte-identical to 19.0. |
| Odoo 19.0 | Verified | Introduced in 19.0 by hr_skills; verified against the shipped source. |
| Odoo 18.0 | Not available | Does not exist. |
| Odoo 17.0 | Not available | Does not exist. |
| Odoo 16.0 | Not available | Does not exist. |
Upgrade note. The widget does not exist before Odoo 19. Views built with it will not degrade gracefully on 18: the field falls back to the missing-widget warning, so backports need the widget copied along.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Missing widget warning on a non-HR database | The widget ships with hr_skills; without that module it is not in the registry. Install hr_skills, add it as a dependency, or copy the 60-line widget into your own module. |
| Users cannot edit the date | By design: the widget renders a text span with no input or picker. Use the standard date widget where editing is needed; keep formatted_date for display columns. |
| The color never changes | The expression references a field that is not loaded in the view, or it needs a comparison against today, which the eval context cannot do. Add the referenced field to the view (invisible is fine) or compute a boolean like is_expired on the model and test that. |
| Empty dates show "Indefinite" but you want different wording | The placeholder string is hardcoded in the component; the placeholder attribute is not read. Extend the widget in JavaScript and override the placeholder getter, or accept the stock label. |
| It does nothing on a datetime field | supportedTypes is ["date"] only. Add a related or computed date field and point the widget at that. |
Formatted Date widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
formatted_date | Read-only date columns that need custom formatting or conditional color | View-level format control and expression-driven colors; never editable |
date | Any date users actually set | Full date picker and editing, but always the locale's numeric format |
| remaining_days | Deadlines where urgency matters more than the date | Renders relative labels like In 5 days or Today instead of the date |
| daterange | A period with a start and an end in one control | Editable two-date picker pair, not a formatted label |
Frequently asked questions
How do I show an Odoo date as "Mar 2026" style text?+
Can formatted_date color the date red when it is overdue?+
Why does an empty date say Indefinite?+
Does formatted_date follow the user's language?+
Can I use it outside HR?+
Lists your team can read at a glance?
Readable date labels, self-coloring deadline columns, and views that triage themselves are small customizations with daily payoff. We tune Odoo list and form views field by field, and when a widget like this one lives in the wrong module, we port it cleanly into yours.
Polish our Odoo views