daterange
Time off requests, events and planned tasks all edit two dates in one calendar popover. That is the daterange widget: one field element, a paired date field, and more options than any other date widget in Odoo.
| Studio name | Date Range |
|---|---|
| Technical name | daterange |
| Field types | date, datetime |
| Views | form, list (single unprefixed registration, so it renders wherever the field appears) |
| Also registered as | defined in the same file and registry chain as date and datetime |
| Module | web, present in every Odoo database |
| Used in core | 21 occurrences across 9 modules, including hr_holidays, calendar, project, event, mail, sale |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0 |
| No-code setup | Yes, via Odoo Studio (Enterprise), with a dedicated documented flow |
| Alternatives | date, datetime, remaining_days |
What the Date Range widget 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 |
|---|---|---|
start_date_field | field name | Names the date or datetime field that holds the start of the range, when the widget sits on the end field. The named field is injected into the view automatically as an editable dependency. |
end_date_field | field name | Names the field holding the end of the range, when the widget sits on the start field. Mutually exclusive with start_date_field: setting both logs a console warning and only start_date_field is used. |
always_range | boolean | Always displays both inputs, even when empty, and removes the range toggler. Use it when a record only makes sense with both dates filled.(default: false) |
min_date | string | Earliest selectable date, ISO formatted (2026-12-31) or the literal today. Earlier dates are grayed out in the picker. |
max_date | string | Latest selectable date, same format as min_date. Later dates are grayed out. |
warn_future | boolean | Shows a warning icon with the message This date is in the future when either selected date is past today.(default: false) |
min_precision | selection | Smallest unit the picker forces the user through: days, months, years or decades. Set months to make the picker a month selector. |
max_precision | selection | Largest unit available when zooming out in the picker: days, months, years or decades. |
numeric | boolean | Switches display from the written format (Dec 31, 2026) to the numeric format of the user's language (12/31/2026). List columns switch to the narrower numeric width.(default: false)(since Odoo 19.0) |
rounding | integer | Minute step of the time selector on datetime fields. Set 15 to work in quarter hours. If rounding is not a number and show_seconds is enabled, the source drops to second-level steps.(default: 5) |
show_time | boolean | On datetime fields, hides the time part of the displayed value when set to false. Useful to declutter list views while keeping full timestamps in the database.(default: true) |
show_seconds | boolean | Shows seconds in the readable datetime format. Odoo 18 defaulted this to true; 19.0 flipped the default to false.(default: false) |
placeholder_field | field name | Reads the placeholder text from another field on the record instead of a fixed placeholder attribute.(since Odoo 19.0) |
Never set both start_date_field and end_date_field. The source treats this as a mistake, logs a console warning, and honors only start_date_field. Also worth knowing: if rounding is not a number and show_seconds is on, the picker switches to second-level rounding automatically.
Working examples
How the two fields stay in sync
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. The development branch shows no option changes, only an internal framework rewrite; see below. |
| Odoo 19.0 | Verified | All 13 options in the table confirmed against the shipped source. |
| Odoo 18.0 | Partial / changed | No numeric or placeholder_field yet, a condensed option existed, and seconds displayed by default. Verified against the 18.0 source. |
Upgrading from Odoo 18? Three changes: the undocumented condensed display option was removed in 19.0, the numeric format option and placeholder_field were added, and the seconds default flipped (18.0 showed seconds by default, 19.0 hides them unless show_seconds is set). XML using condensed keeps working but the option is ignored.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Console warning about start_date_field and end_date_field | Both options are set on the same field, which the source treats as a configuration error. Keep exactly one of the two options; the widget belongs on one field of the pair. |
| Record will not save and names a field that is not on the form | The injected partner field is required but empty; the widget's cross-field validation blocks the save. Fill both dates, make the partner field not required, or show it on the form so the error is visible. |
| No toggle arrow to add an end date | The toggler is hidden when the field is required or always_range is set, and when no partner field option is configured. Check the options: an optional range needs start_date_field or end_date_field set and no always_range. |
| End date shows only a time | On datetime ranges that end the same day they start, the widget intentionally drops the repeated date part. Nothing to fix; select an end date on another day and the date part returns. |
| Time selector skips minutes | The default rounding is 5 minutes. Set options="{'rounding': 1}" for minute precision, or a larger step like 15 for quarter hours. |
Date Range widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
daterange | A period with a start and an end edited together | One widget drives two fields through a shared picker with cross-field validation |
date | A single date with no paired end | Same picker, no pairing, no range logic |
datetime | A single timestamp | One value; daterange composes this widget for each end of the pair |
| remaining_days | Deadlines your team scans by urgency | Displays In 5 days instead of the date itself |
Frequently asked questions
How do I add a date range in Odoo without code?+
Which field does the widget go on, the start or the end?+
Does the second field need to be in the view?+
Can the end date be optional?+
Why does saving fail with a message about a hidden field?+
Does daterange work on date fields or only datetime?+
Scheduling screens your team actually trusts?
Leave requests that block on hidden required fields, rental periods that save half filled, planners that allow impossible ranges: date logic is where Odoo forms quietly leak errors. We build and repair scheduling flows, cross-field validation and planning views on Odoo 16 through 19.
Book a free consultation