timezone_mismatch
A timezone dropdown that checks itself against your browser and, when they disagree, prints the actual current time in the selected zone next to its name.
| Technical name | timezone_mismatch |
|---|---|
| Field types | selection |
| Views | form |
| Module | web, present in every Odoo database |
| Used in core | 1 occurrence, the timezone on a working schedule in resource |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. Studio offers a plain selection; the comparison needs the offset option |
| Alternatives | selection, dynamic_selection, filterable_selection |
What the timezone mismatch field does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
tz_offset_field | field | Names the char field holding the record's timezone offset, formatted as a signed four digit string such as +0530. The widget compares that string against the browser's own offset.(default: tz_offset) |
mismatch_title | string | Hover text shown when a mismatch is detected. Core replaces the default with advice specific to working schedules. Ignored when the field is empty, which has its own message.(default: a generic warning about the browser timezone) |
placeholder_field | field | Inherited from the selection widget. Shows another field's value as a hint when this one is empty. |
The offset field is doing the real work. The widget never resolves the zone name itself; it compares the browser's offset against a formatted offset string that the server put in the companion field. That has a consequence worth knowing: two different timezones sharing the same current offset are considered matching, and a zone whose offset changes with daylight saving will match or mismatch depending on the time of year.
Working examples
Comparing strings, not zones
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Behavior identical on the development branch; only the props syntax changes. |
| Odoo 19.0 | Verified | Verified against the shipped source. Byte-identical to Odoo 18. |
| Odoo 18.0 | Verified | Identical behavior and options. |
| Odoo 17.0 | Verified | Same options. This is where the component moved to the current descriptor style. |
| Odoo 16.0 | Verified | Same options and comparison, with the older component conventions. |
Upgrade note. The two options and the behavior have been the same since Odoo 16, so views carry over unchanged. Odoo 17 was where the component moved to the current descriptor style and stopped reading the value from a props shortcut, which affects custom JavaScript patches rather than XML. Odoo 18 and Odoo 19 are byte-identical.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The mismatch never triggers | The offset field is empty or not loaded, so the comparison has nothing to work with. Make sure the offset field is computed and present in the view, and that its name matches the option. |
| A mismatch is flagged for the same country | The comparison is on the current offset, and daylight saving can put two zones out of step for part of the year. Expected. Check the appended local time to confirm whether it actually matters. |
| Two different zones are treated as matching | They share the same current offset, and the widget compares offsets rather than zone names. Expected. If the exact zone matters, verify it rather than relying on the warning. |
| The warning appears on an empty field | Intended. An unset timezone is treated as a mismatch, with its own message. Set a timezone on the record. |
| No local time appears next to the zone | The time is appended only to the selected option, and only when a mismatch is detected. Nothing to fix; a matching timezone shows the plain label. |
| An error parsing the offset | The offset field does not hold a signed four digit string. Format it as +0530 or -0400; the widget parses it with a regular expression. |
Timezone mismatch field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
timezone_mismatch | Timezone fields on records configured by somebody in another zone | Compares the record's offset with the browser's and prints the selected zone's current local time |
| selection | A timezone field where a mismatch is harmless | No comparison, no warning and no local time |
| dynamic_selection | Selections whose values come from the server | A different way of sourcing the choices, no timezone awareness |
| filterable_selection | Long selections that need narrowing | Filters the values rather than validating them |
Frequently asked questions
How does timezone_mismatch decide there is a mismatch?+
Why does it show a time next to the timezone?+
Why is an empty timezone treated as a mismatch?+
Do I have to set the offset field option?+
Can two different zones be treated as the same?+
Schedules and leave that go wrong by exactly one hour
Timezones, working schedules and leave calculations interact in ways that only show up in payroll. We configure Odoo HR and resource schedules for distributed teams on versions 16 through 19, and test the edge cases before they reach an employee.
Book a free consultation