Skip to content

Knowledge

KnowledgeNamespace for the knowledge.article model (Odoo Enterprise), accessed as client.knowledge.

knowledge

Knowledge article operations for Vodoo.

KnowledgeNamespace

KnowledgeNamespace(client: OdooClient)

Bases: GeneratedKnowledgeNamespace

Namespace for knowledge.article model.

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

create

create(name: str, *, body: str | None = None, parent_id: int | None = None, category: str | None = None, icon: str | None = None, **extra_fields: Any) -> int

Create a knowledge article.

PARAMETER DESCRIPTION
name

Article title/name.

TYPE: str

body

Article body as markdown text (converted to HTML).

TYPE: str | None DEFAULT: None

parent_id

Parent article ID.

TYPE: int | None DEFAULT: None

category

Article category (workspace/private/shared).

TYPE: str | None DEFAULT: None

icon

Emoji/icon for the article.

TYPE: str | None DEFAULT: None

**extra_fields

Additional fields to set on the article.

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
int

ID of created article.

Source code in src/vodoo/knowledge.py
def create(
    self,
    name: str,
    *,
    body: str | None = None,
    parent_id: int | None = None,
    category: str | None = None,
    icon: str | None = None,
    **extra_fields: Any,
) -> int:
    """Create a knowledge article.

    Args:
        name: Article title/name.
        body: Article body as markdown text (converted to HTML).
        parent_id: Parent article ID.
        category: Article category (workspace/private/shared).
        icon: Emoji/icon for the article.
        **extra_fields: Additional fields to set on the article.

    Returns:
        ID of created article.
    """
    values = _build_article_values(
        name,
        body=body,
        parent_id=parent_id,
        category=category,
        icon=icon,
        **extra_fields,
    )
    return self._client.create(self._model, values)

url

url(record_id: int) -> str

Get the web URL for a knowledge article.

Tries the article_url field first, falls back to the standard URL.

Source code in src/vodoo/knowledge.py
def url(self, record_id: int) -> str:
    """Get the web URL for a knowledge article.

    Tries the ``article_url`` field first, falls back to the standard URL.
    """
    article = self.get(record_id, fields=["article_url"])
    if article.get("article_url"):
        return str(article["article_url"])
    return super().url(record_id)

display_article_detail

display_article_detail(article: dict[str, Any], show_html: bool = False) -> None

Deprecated compatibility shim for CLI article rendering.

Source code in src/vodoo/knowledge.py
def display_article_detail(article: dict[str, Any], show_html: bool = False) -> None:
    """Deprecated compatibility shim for CLI article rendering."""
    from vodoo.cli.display import display_article_detail as render

    render(article, show_html)