Skip to main content
iVentureTeam

timesheet_duration_uom

The same number is 7.5 hours or 0.94 days depending on how your company records time. This widget picks the right renderer, and swaps in an hours-only variant when the setting says time.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated September 2, 20265 min read
Technical nametimesheet_duration_uom
Field typesfloat
Viewsform, list, kanban
Modulehr_timesheet, the Timesheets app
Used in core1 occurrence, the duration column on the timesheet views in hr_timesheet
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0
No-code setupNo. It depends on the timesheet unit service and its companion components
Alternativestimesheet_uom, timesheet_uom_no_toggle, float_time, float

What the timesheet duration field does

Companies record time differently. Some log hours and minutes, some log fractions of a day, and Odoo stores the underlying number the same way regardless. The display has to follow the setting, otherwise a timesheet is unreadable to the people filling it in.

Odoo has a service that answers which unit is in force and hands back the right component. This widget uses that service and adds one refinement: when the setting is hours and minutes, it asks for an hour-specific component rather than the general one.

The distinction matters because a duration and a time of day format almost identically and mean completely different things. The hour component is written for durations, so a value that exceeds a day still reads as a duration rather than wrapping like a clock.

What this means for your team

Timesheet adoption depends on the entry screen matching how people think about their day. A consultancy that bills in days and an agency that bills in hours will both reject a screen that shows them the other unit, and neither will articulate it as a formatting problem; they will just stop filling in timesheets.

What makes this widget worth knowing is that the choice is a single company setting, applied everywhere through a service. If a client asks to change how time is recorded, the answer is a setting rather than a project, provided their custom views use these widgets rather than plain decimal fields.

Working examples

The core usage

<field name="unit_amount"
       widget="timesheet_duration_uom"
       decoration-danger="unit_amount > 24"
       decoration-muted="unit_amount == 0"/>

The decorations are ordinary list decorations. The widget itself takes no options; the unit comes from the company setting.

Its sibling widgets

# same family, different purposes
timesheet_uom             # the general unit-aware widget
timesheet_uom_no_toggle   # without the unit toggle
timesheet_duration_uom    # this one, hour-aware for durations

Choosing between them is about what the number means, not about how it is stored.

What it is not

<field name="unit_amount" widget="float_time"/>

Always hours and minutes, whatever the company setting says. Correct only where the unit genuinely cannot vary.

One getter, resolved through a service

The widget is fifteen lines and its whole content is one getter. It asks the timesheet unit service which widget name is configured and, if that name is the hours and minutes format, returns the hour-specific component from the same service. Otherwise it defers to the parent's answer.

Two things follow from that structure. The decision is made at render time, so a change to the company setting takes effect for every field using this widget without any per-view change. And because the component is fetched from the service rather than imported directly, another module can substitute its own implementation for a given unit.

The reason the hour case is special is worth stating plainly. Durations and times of day both format as hours and minutes, but a duration can legitimately exceed twenty four, and it should never be interpreted as a point in the day. The hour component is written with that in mind, which is what the substitution buys.

Everything else, including the toggle behavior and the formatting for other units, is inherited from the general timesheet unit widget.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Byte-identical to Odoo 19 on the development branch.
Odoo 19.0VerifiedVerified against the shipped source. Byte-identical to Odoo 18.
Odoo 18.0VerifiedFirst version.
Odoo 17.0Not availableWidget does not exist.
Odoo 16.0Not availableWidget does not exist.

Upgrade note. Nothing to do. The widget arrived in Odoo 18 and the Odoo 18 and Odoo 19 files are byte-identical. Databases coming from Odoo 17 gain it with the standard timesheet views.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable and this may still change; we re-verify the page after release.

Byte-identical. The file on the development branch matches Odoo 19 exactly. Because the widget resolves its component through a service, any change to how timesheet units are rendered flows through without this file changing.

Common problems and fixes

SymptomCause and fix
Durations show in the wrong unitThe company's timesheet unit setting is not what you expect; the widget follows it. Change the setting rather than the view.
A duration over 24 hours looks wrongThe field is using a clock-oriented widget rather than this one. Use timesheet_duration_uom, which substitutes a duration-aware hour component.
Options are ignoredThe registration has no extractor and no supported types. Nothing to configure here.
Custom views still show a raw decimalThey use a plain float field rather than one of the timesheet widgets. Switch the field to this widget so it follows the company setting.
Missing widget errorThe timesheets module is not installed in that database. Install Timesheets.

Timesheet duration field vs the alternatives

WidgetBest forKey difference
timesheet_duration_uomTimesheet durations that must follow the company's recording unitSubstitutes a duration-aware hour component when the unit is hours and minutes
timesheet_uomGeneral unit-aware timesheet quantitiesNo special handling for the hours case
timesheet_uom_no_toggleThe same without the unit toggleRemoves the affordance to switch units in place
float_timeValues that are always hours and minutesIgnores the company setting entirely
floatAn ordinary decimalNo time formatting at all

Use the general timesheet unit widget where the number is a quantity of work rather than a duration, and the fixed hours and minutes widget only where the unit genuinely cannot vary by company. A plain decimal field is the wrong choice on any timesheet, because it ignores the setting entirely.

Frequently asked questions

What does timesheet_duration_uom decide?+
Which component renders the number. It asks the timesheet unit service what the company is configured for and, when that is hours and minutes, substitutes an hour-specific component; otherwise it uses the inherited behavior.
Why a separate hour component?+
Because a duration is not a time of day. They format almost identically, but a duration can exceed twenty four and must not read as a clock value.
Does it take any options?+
None. The registration provides only a component, with no options, no extractor and no supported types.
How do I change the unit?+
In the company's timesheet settings. The widget resolves the unit at render time, so every field using it follows the change with no view edits.
Which versions have it?+
Odoo 18 onwards, and the file is byte-identical in Odoo 18, Odoo 19 and on the Odoo 20 development branch.

Timesheets people actually fill in

Recording units, approval flows and the billing rules behind them decide whether timesheets are a habit or a monthly chase. We implement Odoo Timesheets and the invoicing that follows, on versions 16 through 19.

Book a free consultation

How this page was produced

The single getter, the service lookup and the substitution of the hour component were read from timesheet_duration_uom.js on the Odoo 19.0 branch, with the inherited behavior read from the timesheet unit widget in the same module. The usage comes from hr_timesheet/views/hr_timesheet_views.xml. Version coverage comes from the absence of the file on 16.0 and 17.0 and byte comparisons against 18.0 and the public development branch. Spotted an error? Tell us and we will correct the page.