name_with_subtask_count
The (2/5 sub-tasks) suffix on task names in Odoo project lists comes from name_with_subtask_count, a char widget with auto-loaded counters and a surprising history.
| Technical name | name_with_subtask_count |
|---|---|
| Field types | char |
| Views | list (task and to-do lists, including portal project sharing) |
| Module | project |
| Used in core | 7 occurrences across project and project_todo, on task list views including the project sharing portal |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. Applied in view XML on the task name; Studio has no equivalent widget entry |
| Alternatives | char, x2many_buttons, subtask_counter (view widget) |
What the Task Name with Sub-task Count does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
placeholder_field | field name | Inherited from the char widget: a char or text field on the record supplying a dynamic placeholder for the name input. |
subtask_count (dependency) | integer field, auto-loaded | Total child tasks. Declared in fieldDependencies, fetched automatically; the counter span renders only when this is nonzero. |
closed_subtask_count (dependency) | integer field, auto-loaded | Children in a closed state; the numerator of the (closed/total) display. |
The counters are dependencies, not options. subtask_count and closed_subtask_count are integer fields on project.task that the widget requests through fieldDependencies. There is no option to point the widget at different fields; reusing it on a model without those exact field names will not render a counter.
Working examples
One letter, three behaviors: the version history
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. File unchanged on the development branch. See below. |
| Odoo 19.0 | Verified | Verified against the shipped source; identical to 18.0 apart from the pragma. |
| Odoo 18.0 | Verified | First version where fieldDependencies is spelled correctly, making the counters truly automatic. |
| Odoo 17.0 | Partial / changed | Source misspells the key as fieldsDependencies, so counters render only if the count fields are otherwise present in the view. |
| Odoo 16.0 | Partial / changed | Same widget name, different mechanism: renders a server-computed child_text gated by allow_subtasks, with no closed count. |
Upgrade note. Moving custom task views to 18 or 19 from either earlier regime is safe and usually an improvement: delete any manually added counter fields from the XML and let the dependencies do the work. The widget name itself has been stable since 16.0.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| No counter appears on tasks that have sub-tasks in Odoo 17 | The 17.0 source misspells the dependencies key, so the count fields are not auto-loaded. Add subtask_count and closed_subtask_count as invisible fields to the view, or upgrade; 18.0 fixed the spelling. |
| Counter missing on a custom model | The widget depends on fields literally named subtask_count and closed_subtask_count, which exist on project.task only. On other models, add equivalent computed fields and a small widget variant, or display a computed suffix in the name itself. |
| Counter shows on some views but not others | Views render the name with the plain char widget instead of this one. Set widget="name_with_subtask_count" on the name field in each list view that should show it. |
| Counts look wrong compared to the sub-task list | The counts are server-computed fields; access rules or filters can make the visible children differ from the computed totals. Check record rules and the definition of the compute; the widget displays whatever the fields hold. |
| Migrated 16.0 view lost its sub-task text | The 16.0 mechanism used allow_subtasks and child_text, both gone in later versions. Keep the widget name and remove references to the old fields; the modern counters take over automatically from 18.0. |
Task Name with Sub-task Count vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
name_with_subtask_count | Task name columns that should reveal sub-task progress | Appends an auto-loaded (closed/total) counter to the plain name |
char | Names without any suffix logic | No dependencies, no counter, marginally lighter rendering |
| x2many_buttons | Jumping to related records rather than counting them | Renders the related records as clickable buttons with an overflow count |
subtask_counter (view widget) | Kanban cards in the project app | The kanban counterpart lives in a separate view widget, not this field widget |
Frequently asked questions
What shows the (2/5 sub-tasks) text in Odoo task lists?+
Do I need to add the count fields to my view?+
Why did the counter break when we upgraded from Odoo 16?+
Can I use name_with_subtask_count on models other than tasks?+
Which counter is the first number?+
Does the widget work in the portal project sharing views?+
Project views that hide the work inside the work?
Sub-task hierarchies, progress counters and portal sharing only help when the views expose them where your team looks. We restructure Odoo project screens, from list columns to kanban cards, around how your delivery process actually flows.
Book a free consultation