Skip to content

Project Tasks

TaskNamespace for the project.task model, accessed as client.tasks.

project_tasks

Project task operations for Vodoo.

TaskNamespace

TaskNamespace(client: OdooClient)

Bases: _TaskAttrs, DomainNamespace

Project task namespace.

Source code in src/vodoo/_domain.py
def __init__(self, client: OdooClient) -> None:
    self._client = client

create

create(name: str, project_id: int, description: str | None = None, user_ids: list[int] | None = None, tag_ids: list[int] | None = None, parent_id: int | None = None, **kwargs: Any) -> int

Create a new project task.

PARAMETER DESCRIPTION
name

Task name

TYPE: str

project_id

Project ID (required)

TYPE: int

description

Task description (HTML)

TYPE: str | None DEFAULT: None

user_ids

List of assigned user IDs

TYPE: list[int] | None DEFAULT: None

tag_ids

List of tag IDs

TYPE: list[int] | None DEFAULT: None

parent_id

Parent task ID (for subtasks)

TYPE: int | None DEFAULT: None

**kwargs

Additional field values

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
int

ID of created task

Source code in src/vodoo/project_tasks.py
def create(
    self,
    name: str,
    project_id: int,
    description: str | None = None,
    user_ids: list[int] | None = None,
    tag_ids: list[int] | None = None,
    parent_id: int | None = None,
    **kwargs: Any,
) -> int:
    """Create a new project task.

    Args:
        name: Task name
        project_id: Project ID (required)
        description: Task description (HTML)
        user_ids: List of assigned user IDs
        tag_ids: List of tag IDs
        parent_id: Parent task ID (for subtasks)
        **kwargs: Additional field values

    Returns:
        ID of created task
    """
    values, context = _build_task_values(
        name, project_id, description, user_ids, tag_ids, parent_id, **kwargs
    )
    return self._client.create(self._model, values, context=context)

create_tag

create_tag(name: str, color: int | None = None) -> int

Create a new project tag.

PARAMETER DESCRIPTION
name

Tag name

TYPE: str

color

Tag color index (0-11, optional)

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
int

ID of created tag

Source code in src/vodoo/project_tasks.py
def create_tag(self, name: str, color: int | None = None) -> int:
    """Create a new project tag.

    Args:
        name: Tag name
        color: Tag color index (0-11, optional)

    Returns:
        ID of created tag
    """
    values: dict[str, Any] = {"name": name}
    if color is not None:
        values["color"] = color
    assert self._tag_model is not None
    return self._client.create(self._tag_model, values)

delete_tag

delete_tag(tag_id: int) -> bool

Delete a project tag.

PARAMETER DESCRIPTION
tag_id

Tag ID

TYPE: int

RETURNS DESCRIPTION
bool

True if successful

Source code in src/vodoo/project_tasks.py
def delete_tag(self, tag_id: int) -> bool:
    """Delete a project tag.

    Args:
        tag_id: Tag ID

    Returns:
        True if successful
    """
    assert self._tag_model is not None
    return self._client.unlink(self._tag_model, [tag_id])