Skip to main content
iVentureTeam

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.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 18, 2026Updated August 18, 20265 min read
Technical namename_with_subtask_count
Field typeschar
Viewslist (task and to-do lists, including portal project sharing)
Moduleproject
Used in core7 occurrences across project and project_todo, on task list views including the project sharing portal
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupNo. Applied in view XML on the task name; Studio has no equivalent widget entry
Alternativeschar, x2many_buttons, subtask_counter (view widget)

What the Task Name with Sub-task Count does

In a task list, a parent task with eight children and a parent task with none look identical unless something says otherwise. This widget is that something: it renders the task name exactly like the char widget, then appends a muted counter, closed over total, in the form (2/5 sub-tasks), but only when subtask_count is nonzero.

The implementation is refreshingly small: a template inheritance that adds one span after the formatted value, and a descriptor that spreads the standard charField plus two fieldDependencies entries. Those dependencies are the interesting part: they tell the view machinery to fetch subtask_count and closed_subtask_count whenever the widget is present, so the counters arrive without anyone adding the fields to the view XML.

What this means for your team

Sub-task counters change how teams read a backlog. A project lead scanning a list sees instantly which items are containers of work versus single actions, and the closed-over-total ratio doubles as a progress bar in four characters: (4/5) reads as "almost done" without opening anything.

The reason this page documents the widget's version history in detail is practical, not archaeological. Teams migrating custom task views from 16 or 17 regularly file "the sub-task counter disappeared" tickets, and the cause differs by version: in 16 the whole mechanism was a different server-computed field, and in 17 a one-letter typo in the source meant the counter silently depended on the view happening to include the count fields. Knowing which regime your custom views were built against turns a confusing UI regression into a five-minute fix.

Supported options in Odoo 19

Verified against project_task_name_with_subtask_count_char_field.js in the Odoo 19.0 project module. The widget declares nothing of its own; the descriptor spreads charField, so the char widget's declared option and extractProps knobs apply, and the two field dependencies below are the widget's only additions.

OptionTypeWhat it does
placeholder_fieldfield nameInherited 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-loadedTotal child tasks. Declared in fieldDependencies, fetched automatically; the counter span renders only when this is nonzero.
closed_subtask_count (dependency)integer field, auto-loadedChildren 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

How core uses it (task list)

<field name="name"
       widget="name_with_subtask_count"
       string="Title"/>

No options, no extra fields in the XML. The dependencies mechanism fetches both counters behind the scenes.

What renders

Prepare launch checklist  (3/7 sub-tasks)

The suffix is a muted span, present only when subtask_count is truthy; tasks without children render exactly like a plain char field.

One letter, three behaviors: the version history

The 17.0 typo deserves its own section because it is invisible unless you diff the file across versions, and it explains real-world behavior differences.

In 17.0 the descriptor key reads fieldsDependencies, with an extra s. The view machinery looks for fieldDependencies, so the declaration was ignored: the counters were not auto-loaded, and the counter span only rendered on views that happened to include subtask_count and closed_subtask_count anyway. Core's own views mostly did, which is why the bug shipped unnoticed.

18.0 fixed the spelling, and from there the widget behaves as designed: drop it on the name field and the counters come along automatically. The 18.0 and 19.0 files are identical apart from the module pragma, and the master branch carries 19.0's file unchanged.

16.0 is a different widget wearing the same name. It rendered a server-computed child_text string (something like "5 sub-tasks") gated by an allow_subtasks feature flag, with no closed count at all. Custom views ported straight from 16 therefore need the underlying fields rethought, not just the widget name kept.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. File unchanged on the development branch. See below.
Odoo 19.0VerifiedVerified against the shipped source; identical to 18.0 apart from the pragma.
Odoo 18.0VerifiedFirst version where fieldDependencies is spelled correctly, making the counters truly automatic.
Odoo 17.0Partial / changedSource misspells the key as fieldsDependencies, so counters render only if the count fields are otherwise present in the view.
Odoo 16.0Partial / changedSame 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

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable until release, and we re-verify this page against the shipped version.

For this widget the branch currently shows no change: the 19.0 file is carried as is, dependencies, template and registration included. Whatever Odoo 20 does to the underlying char widget will flow in through the descriptor spread automatically.

Common problems and fixes

SymptomCause and fix
No counter appears on tasks that have sub-tasks in Odoo 17The 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 modelThe 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 othersViews 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 listThe 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 textThe 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

WidgetBest forKey difference
name_with_subtask_countTask name columns that should reveal sub-task progressAppends an auto-loaded (closed/total) counter to the plain name
charNames without any suffix logicNo dependencies, no counter, marginally lighter rendering
x2many_buttonsJumping to related records rather than counting themRenders the related records as clickable buttons with an overflow count
subtask_counter (view widget)Kanban cards in the project appThe kanban counterpart lives in a separate view widget, not this field widget

The practical test: this widget is for the task name column specifically. For navigating to the children rather than counting them, or for names on other models, the alternatives below fit better.

Frequently asked questions

What shows the (2/5 sub-tasks) text in Odoo task lists?+
The name_with_subtask_count widget on the task's name field. It renders the name like a normal char field and appends a muted counter of closed over total sub-tasks whenever the task has children.
Do I need to add the count fields to my view?+
Not on Odoo 18 or 19: the widget declares subtask_count and closed_subtask_count as field dependencies and the view machinery loads them automatically. On 17.0 you do need them in the view, because the source misspells the dependencies key and the declaration is ignored.
Why did the counter break when we upgraded from Odoo 16?+
Because 16.0's version of this widget rendered a different thing entirely: a server-computed child_text string gated by the allow_subtasks flag. Views and customizations referencing those fields need updating; from 18.0 the modern counter works with no extra fields in the view.
Can I use name_with_subtask_count on models other than tasks?+
Not usefully. The dependency field names are hardcoded to project.task's subtask_count and closed_subtask_count. On another model the counter simply never renders; a small custom widget with your own dependencies is the clean solution.
Which counter is the first number?+
Closed sub-tasks. The display is closed over total, so (4/5 sub-tasks) means four of five children are in a closed state, effectively a progress readout.
Does the widget work in the portal project sharing views?+
Yes. Core applies it in the project sharing task lists too, which is part of its 7 core usages across project and project_todo.

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

How this page was produced

This page was verified by reading project_task_name_with_subtask_count_char_field.js and its template in the Odoo 19.0 project module, and by diffing the same file across 16.0, 17.0, 18.0 and master, which is how the 17.0 fieldsDependencies misspelling and the 16.0 child_text mechanism were confirmed. Usage counts come from scanning core view XML. The Odoo 20 section reads the unreleased development branch and is marked as such. Spotted something we missed? Tell us.