Skip to main content
iVentureTeam

many2one_work_entry_type

In payroll's work entry views, every type shows a small colored code chip (ATT, OT, SL) in front of its name. That chip is many2one_work_entry_type, an hr_work_entry widget that fetches and renders the type's short code and calendar color everywhere, dropdown included.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 20, 2026Updated August 20, 20265 min read
Technical namemany2one_work_entry_type
Field typesmany2one
Viewsform, list
Modulehr_work_entry
Used in core4 occurrences across 1 module: hr_work_entry (work entry form, list and quick edit views)
VersionsOdoo 20.0, Odoo 19.0
No-code setupNo. It ships preapplied on work entry views; Studio offers only the generic Many2one.
Alternativesmany2one, many2one_avatar_employee, timesheet_uom

What the Work entry type widget does

many2one_work_entry_type dresses the standard many2one with the visual identity of work entry types. Each type in payroll carries a short code (display_code) and a calendar color, and this widget shows both as a compact chip, a rounded 5 character badge tinted with the o_calendar_color_<n> class, in two places: before the field's input and inside every row of the autocomplete dropdown.

Two source mechanisms make that work. The widget declares display_code and color as field dependencies, and its m2oProps getter extends the relational specification with both fields, so the dropdown's search results arrive with code and color attached instead of just names. A custom Many2One subclass then pipes the full record, not just id and name, into the update path.

One hardcoded assumption: the render hook reads record.data.work_entry_type_id literally to decide which data feeds the chip. On a field with any other name the chip falls back to the record's own data and shows nothing useful.

What this means for your team

Payroll admins live in dense screens where Attendance, Overtime and Sick Time differ by one word. The code chip plus color gives each type a stable visual identity, the same one used on the work entry calendar, so scanning hundreds of entries against the calendar becomes pattern matching instead of reading.

If you run custom payroll flows, the widget rewards data discipline: give every work entry type a short, distinct display_code and a color, and the whole chain, calendar, list, form dropdown, stays legible. Types without a code render an empty chip, which looks broken to users.

Supported options in Odoo 19

The widget declares no options of its own; everything is inherited from the standard many2one through buildM2OFieldDescription. The table lists the inherited set as declared in 19.0, since all of it works here, and Odoo's own views use two of them.

OptionTypeWhat it does
no_createbooleanInherited from many2one. Prevents creating work entry types from the dropdown; Odoo core sets it on validated work entries.(default: false)
no_openbooleanInherited from many2one. Removes the internal link to the type's form; also used by core on validated entries.(default: false)
no_quick_createbooleanInherited from many2one. Hides only the inline Create "x" dropdown entry.(default: false)
no_create_editbooleanInherited from many2one. Hides the Create and Edit dialog entry.(default: false)
search_thresholdintegerInherited from many2one, new in 19. Starts searching only after this many typed characters.(since Odoo 19.0)
placeholder_fieldfield nameInherited from many2one, new in 19. Reads the input placeholder from another field on the record.(since Odoo 19.0)

The chip content is not configurable by options: it always shows display_code tinted by color. Changing what appears means editing the work entry type records themselves, not the view.

Working examples

The plain usage from hr_work_entry_views.xml:

<field name="work_entry_type_id" widget="many2one_work_entry_type"/>

The locked down variant on validated entries, combining inherited many2one options with readonly logic:

<field name="work_entry_type_id" readonly="state == 'validated'"
       options="{'no_create': True, 'no_open': True}"
       widget="many2one_work_entry_type"/>

Specification injection and the render time chip switch

The interesting engineering is in how the chip stays correct:

The specification injection. A normal many2one autocomplete fetches id and display name. This widget's m2oProps getter adds specification: { display_code: 1, color: 1 }, so every dropdown row carries the chip data with no extra round trips. The custom WorkEntryTypeMany2One subclass overrides the autocomplete's update callback to hand the full record through, because the default path would strip the extra fields.

The render time switch. On each render the field checks whether record.data.work_entry_type_id carries a color; if so the chip feeds from the linked type, otherwise from the record's own data. This is what ties the widget to that exact field name.

A typing quirk. The dependency declaration types color as char although work entry type colors are integer indexes; the value is only ever interpolated into a CSS class name, so the mismatch is harmless in practice.

Version compatibility

VersionStatusNotes
Odoo 20.0Partial / changedNot released. Same registration, but the chip component is deleted and missing chip data is re fetched on selection; see below.
Odoo 19.0VerifiedWidget introduced; verified against the shipped source and tested on a clean database.
Odoo 18.0Not availableDoes not exist; work entry type fields use the plain many2one.
Odoo 17.0Not availableDoes not exist.
Odoo 16.0Not availableDoes not exist.

Views written for 19 carry over conceptually to the development branch, but any JavaScript that imported the WorkEntryType chip component will break on 20: the component is deleted there.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The changes below are read from the public development branch and are not final until release.

The chip subcomponent is deleted. Master removes the WorkEntryType component and its extractData helper from this file; the field becomes a lean composition over the shared many2OneFieldProps, keeping the same registration, dependencies and specification injection.

Missing data is re fetched. The autocomplete update becomes async: when a chosen record lacks display_name, display_code or color, the widget performs an orm.read for exactly those three fields before updating, closing a gap where selections made through nonstandard paths lost their chip.

We will re verify this page against the released branch after the launch.

Common problems and fixes

SymptomCause and fix
The chip renders as an empty gray squareThe selected work entry type has no display_code set. Fill the short code on the work entry type record; keep codes to a few characters.
All chips share the same tintThe types have no color set, so the class falls back to o_calendar_color_0. Assign distinct colors on the work entry type records.
The widget on a custom field shows no chip dataThe render hook reads record.data.work_entry_type_id by hardcoded name. Only use the widget on fields named work_entry_type_id, or fork the component for other names.
Dropdown rows show chips but the field shows none after selectingThe selection path bypassed the widget's custom update, losing the code and color payload (fixed on the development branch by a re fetch). Save and reload the record; on Odoo 20 the widget re reads the three fields automatically.

Work entry type widget vs the alternatives

WidgetBest forKey difference
many2one_work_entry_typeThe work entry type field in payroll views, with code and color chipsInjects display_code and color into the m2o fetch and renders them as a calendar tinted chip
many2oneAny relational field without the chip treatmentPlain autocomplete, no extra fields fetched
many2one_avatar_employeeEmployee pickers with avatarsPrefixes records with avatar images instead of code chips
timesheet_uomDuration display next to work entriesA numeric dispatcher widget, not a relational picker

This widget is purpose built for one field on one model family. For similar chip like effects elsewhere, the avatar and tag widgets below are the generic tools.

Frequently asked questions

What is the many2one_work_entry_type widget in Odoo?+
An hr_work_entry widget that renders the work entry type field as a many2one prefixed with the type's short code chip, tinted with the type's calendar color, both on the field and inside the dropdown rows.
Where do the chip's code and color come from?+
From the display_code and color fields on hr.work.entry.type. The widget declares them as dependencies and injects them into the autocomplete's fetch specification, so dropdown rows carry them without extra queries.
Can I use this widget on my own many2one field?+
Only if the field is named work_entry_type_id: the render hook reads that name literally from record data. For other fields, fork the component and change the field name.
Is many2one_work_entry_type available before Odoo 19?+
No. The widget file does not exist on the 16, 17 or 18 branches; those versions render the work entry type as a plain many2one without chips.
What changes in Odoo 20?+
The development branch deletes the chip subcomponent from this file and makes selection async: records missing display_name, display_code or color are re read from the server before the update, so chips no longer vanish after nonstandard selections.

Payroll screens your team reads at a glance

Work entries, type codes and calendar colors only help when they are configured coherently. We implement Odoo payroll and attendance flows, from work entry type design to custom widgets, so validation days stop being detective work.

Streamline my payroll screens

How this page was produced

This page was verified by reading the Odoo 19.0 hr_work_entry source, work_entry_type_field.js and its XML templates, including the specification getter, the field dependencies and the hardcoded field name in the render hook. Absence in 16 through 18 was checked against those branch trees, and the Odoo 20 section against the public development branch on the day of writing. Behavior was confirmed on a clean Odoo 19 database with payroll work entries. Corrections via our contact page.