project_subtask_hours
Get total sub-task hours for a project in one call, with server-side filters for closed stages, single assignee, and custom periods. Sums delivery, allocated, and effective hours—no pagination needed.
Instructions
Total sub-task hours for one project, filtered server-side, in ONE call.
Sums delivery/allocated/effective hours over the project's sub-tasks (project.task with parent_id set). Use this instead of paginating project.task through search_read — especially for the "exactly one assignee" condition, which Odoo domains cannot express.
Args: project_id: project.project id (int, not name). only_closed_stages: Count only tasks whose stage name is in closed_stage_names (default False). Cancelled tasks DO count toward delivery hours (business decision 2026-07-15). closed_stage_names: Stage names treated as closed (default ["Done", "Cancelled", "Delivered"]). single_assignee_only: Count only tasks with exactly 1 user in user_ids (default False). group_by_month: Also bucket by local-time month of date_end; tasks without date_end are excluded from the buckets and summarised under "no_date_end" (default False). periods: Optional list of {"date_from": "YYYY-MM-DD", "date_to": "YYYY-MM-DD"} ranges applied to date_end, OR-combined (matching per-budget-period filtering, not a union). Empty/omitted = no date filter. timezone_offset: UTC offset for dates (default 7).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>"
},
"name": "project_subtask_hours"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| periods | No | ||
| project_id | Yes | ||
| group_by_month | No | ||
| timezone_offset | No | ||
| closed_stage_names | No | ||
| only_closed_stages | No | ||
| single_assignee_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |