Skip to content

Async Project Tasks

AsyncTaskNamespace for the project.task model, accessed as client.tasks on AsyncOdooClient.

project_tasks

Async project task operations for Vodoo.

AsyncTaskNamespace

AsyncTaskNamespace(client: AsyncOdooClient)

Bases: _TaskAttrs, AsyncDomainNamespace

Async project task namespace.

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

create async

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.

Source code in src/vodoo/aio/project_tasks.py
async 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."""
    values, context = _build_task_values(
        name, project_id, description, user_ids, tag_ids, parent_id, **kwargs
    )
    return await self._client.create(self._model, values, context=context)

create_tag async

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

Create a new project tag.

Source code in src/vodoo/aio/project_tasks.py
async def create_tag(self, name: str, color: int | None = None) -> int:
    """Create a new project tag."""
    values: dict[str, Any] = {"name": name}
    if color is not None:
        values["color"] = color
    assert self._tag_model is not None
    return await self._client.create(self._tag_model, values)

delete_tag async

delete_tag(tag_id: int) -> bool

Delete a project tag.

Source code in src/vodoo/aio/project_tasks.py
async def delete_tag(self, tag_id: int) -> bool:
    """Delete a project tag."""
    assert self._tag_model is not None
    return await self._client.unlink(self._tag_model, [tag_id])