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.
| Technical name | many2one_work_entry_type |
|---|---|
| Field types | many2one |
| Views | form, list |
| Module | hr_work_entry |
| Used in core | 4 occurrences across 1 module: hr_work_entry (work entry form, list and quick edit views) |
| Versions | Odoo 20.0, Odoo 19.0 |
| No-code setup | No. It ships preapplied on work entry views; Studio offers only the generic Many2one. |
| Alternatives | many2one, many2one_avatar_employee, timesheet_uom |
What the Work entry type widget does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
no_create | boolean | Inherited from many2one. Prevents creating work entry types from the dropdown; Odoo core sets it on validated work entries.(default: false) |
no_open | boolean | Inherited from many2one. Removes the internal link to the type's form; also used by core on validated entries.(default: false) |
no_quick_create | boolean | Inherited from many2one. Hides only the inline Create "x" dropdown entry.(default: false) |
no_create_edit | boolean | Inherited from many2one. Hides the Create and Edit dialog entry.(default: false) |
search_threshold | integer | Inherited from many2one, new in 19. Starts searching only after this many typed characters.(since Odoo 19.0) |
placeholder_field | field name | Inherited 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
Specification injection and the render time chip switch
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | Partial / changed | Not released. Same registration, but the chip component is deleted and missing chip data is re fetched on selection; see below. |
| Odoo 19.0 | Verified | Widget introduced; verified against the shipped source and tested on a clean database. |
| Odoo 18.0 | Not available | Does not exist; work entry type fields use the plain many2one. |
| Odoo 17.0 | Not available | Does not exist. |
| Odoo 16.0 | Not available | Does 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
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The chip renders as an empty gray square | The 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 tint | The 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 data | The 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 selecting | The 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
| Widget | Best for | Key difference |
|---|---|---|
many2one_work_entry_type | The work entry type field in payroll views, with code and color chips | Injects display_code and color into the m2o fetch and renders them as a calendar tinted chip |
| many2one | Any relational field without the chip treatment | Plain autocomplete, no extra fields fetched |
| many2one_avatar_employee | Employee pickers with avatars | Prefixes records with avatar images instead of code chips |
| timesheet_uom | Duration display next to work entries | A numeric dispatcher widget, not a relational picker |
Frequently asked questions
What is the many2one_work_entry_type widget in Odoo?+
Where do the chip's code and color come from?+
Can I use this widget on my own many2one field?+
Is many2one_work_entry_type available before Odoo 19?+
What changes in Odoo 20?+
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