Skip to main content
iVentureTeam

subtask_counter

Two numbers on a task row, closed over total, that double as the control for expanding its sub-tasks.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated September 7, 20264 min read
Technical namesubtask_counter
Viewslist (view widget, <widget> element)
Moduleproject, the Project app
Used in coreThe task list in project
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0
No-code setupNo. It is set in view XML and depends on module-specific data
Alternativessubtask_kanban_list, subtasks_one2many, progressbar

What the sub-task counter does

A task with sub-tasks has a progress story that its own stage does not tell. Four of six done is a different situation from one of six, and both look identical if the row only shows a stage.

This widget puts that ratio on the row: closed over total, in a form compact enough for a list column. It also serves as the control for expanding the sub-tasks underneath, so the number and the way to see the detail are the same target.

The compact display is paired with a spelled-out title, so the meaning is available to anyone who cannot infer it from two numbers and a slash.

What this means for your team

Sub-tasks are how most teams model work that is too big for one row and too small for its own project. The failure is that the parent's status stops reflecting reality, and everyone starts opening tasks to find out where things stand.

A visible ratio on the list fixes that at the cheapest possible point. What it does not fix is sub-tasks being used where a checklist would do, which is worth a conversation before the hierarchy gets deep.

Supported options in Odoo 19

The widget declares no options and takes the standard view widget props. It requests two counts as field dependencies, listed below. Read from the sub-task counter source, Odoo 19.0.

OptionTypeWhat it does
closed_subtask_countrequested field dependencyThe first number in the pair. Requested so it is available whatever the list shows.
subtask_countrequested field dependencyThe second number in the pair, the total.
the togglemethod called on the recordOpens or closes the nested sub-task list. The state belongs to the list, not the widget.

The toggle is not the widget's state. Clicking calls a method on the record, so the open or closed state belongs to the list rather than to this component.

Working examples

Placing it

<widget name="subtask_counter"/>

Inside the task list. No attributes.

What is displayed

2/6

Closed over total.

What the title says

2 sub-tasks closed out of 6

The spelled out form, for accessibility.

Four getters and a delegated toggle

There are four getters and one handler, and none of them do anything clever, which is the right outcome for a list cell rendered hundreds of times.

Two getters read the counts straight from the record. Two more build strings: the compact display and the longer title, both translatable with named placeholders so translators can reorder them.

The handler calls a method on the record that toggles the nested sub-task list. Delegating rather than keeping local state is what makes the widget correct when the same task appears twice, or when the list is re-rendered.

The field dependencies are the last piece. Requesting both counts means the numbers are present even in a list that does not include those columns, which is the normal case since the widget replaces them.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Byte-identical to Odoo 19 on the development branch.
Odoo 19.0VerifiedVerified against the shipped source.
Odoo 18.0VerifiedSame counter and toggle.
Odoo 17.0VerifiedSame counter with older component conventions.
Odoo 16.0Not availableWidget does not exist.

Upgrade note. Present since Odoo 17. The counter and its toggle behavior have been stable across those versions, so an upgrade needs no attention here.

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 this page after the release.

Byte-identical. The file on the development branch matches Odoo 19 exactly, including both translatable strings.

Common problems and fixes

SymptomCause and fix
The counter shows zero over zeroThe task has no sub-tasks. Expected. The pair only means something once sub-tasks exist.
Clicking does not expand anythingThe list does not support the nested display. Use it in the standard task list, which does.
The counts look staleThey are stored fields recomputed server side. Reload the list after changing a sub-task's stage.
The numbers are missingThe dependencies were not requested, which should not happen. Check no customization replaced the descriptor.
Options do nothingThe widget declares none. Nothing to configure; the counts drive it.
The widget is missingThe Project module is not installed in that database. Install Project.

Sub-task counter vs the alternatives

WidgetBest forKey difference
subtask_counterShowing sub-task progress on a task row and expanding it in placeA closed over total pair that doubles as the nested list toggle
subtask_kanban_listSub-tasks on a kanban cardA list with creation rather than a counter
subtasks_one2manySub-tasks on the task formA full relation field rather than a counter
progressbarProgress as a barVisual rather than exact counts

A progress bar widget on a percentage field gives a more visual reading of the same idea, at the cost of the exact counts. Showing the two integer fields as columns works too and takes twice the width.

Frequently asked questions

What do the two numbers mean?+
Closed sub-tasks over total sub-tasks. The accessible title spells the same ratio out in words.
Does clicking it expand the sub-tasks?+
Yes. The handler calls a method on the record that toggles the nested list, so the open state belongs to the list rather than the widget.
Do I need to add the count columns?+
No. The widget requests both counts as field dependencies, so they are loaded even when the list does not show them.
Does it have options?+
None. It takes the standard view widget props and reads the two counts.
Which versions have it?+
Odoo 17 onwards, and byte-identical on the Odoo 20 development branch.

Project structures your team will actually maintain

Sub-tasks, stages and dependencies only help if they match how the work really breaks down. We design and implement Odoo Project around your delivery process, on versions 16 through 19.

Book a free consultation

How this page was produced

The two count getters, the compact and spelled out string builders, the delegated toggle call and the requested field dependencies were read from the sub-task counter source on the Odoo 19.0 branch. Version coverage comes from comparing the file across the 17.0 and 18.0 branches and its absence on 16.0, plus a byte comparison against the public development branch. Spotted an error? Tell us and we will correct the page.