Skip to content

API Reference parrot_tools.odoo.helpdesk_normalize

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.odoo.helpdesk_normalize

View source

Pure normalisation helpers for the Softhealer helpdesk (no I/O, no async).

Turns Odoo wire dicts into the derived parts of :class:HelpdeskTicket and normalises the two aggregation result shapes. Everything here must be safe on malformed tenant data: skip, never raise.

Alias HelpdeskLifecycle

Re-exported from parrot_tools.odoo.models.helpdesk_entities.HelpdeskLifecycle.

Alias HelpdeskTicket

Re-exported from parrot_tools.odoo.models.helpdesk_entities.HelpdeskTicket.

Alias StatsGroup

Re-exported from parrot_tools.odoo.models.helpdesk_envelopes.StatsGroup.

Function extra_fields_to_dict

Fold sh.helpdesk.ticket.extra_fields rows into (values, labels) keyed by field_name.

False/None values become ""; a duplicate field_name keeps the last row; rows without a field_name are skipped; a non-list input yields ({}, {}).

extra_fields_to_dict(rows: list[dict[str, Any]] | None) -> tuple[dict[str, str], dict[str, str]]

Parameter Type Default Description
rows list[dict[str, Any]] | None

Returns: tuple[dict[str, str], dict[str, str]]

Function lifecycle_from_record

Derive the lifecycle block from stage_id + the computed booleans (+ next stage and company role).

lifecycle_from_record(record: dict[str, Any], stages: dict[int, dict[str, Any]] | None = None, stage_roles: dict[str, int | None] | None = None) -> HelpdeskLifecycle

Parameter Type Default Description
record dict[str, Any]
stages dict[int, dict[str, Any]] | None None
stage_roles dict[str, int | None] | None None

Returns: HelpdeskLifecycle

Function normalize_stats_groups

Map read_group (<group_by>_count/__count) and formatted_read_group (__count) rows to StatsGroup.

normalize_stats_groups(groups: list[dict[str, Any]], group_by: str, source_method: str) -> list[StatsGroup]

Parameter Type Default Description
groups list[dict[str, Any]]
group_by str
source_method str

Returns: list[StatsGroup]

Function normalize_ticket

Build a :class:HelpdeskTicket preserving every raw field, adding extra_fields and lifecycle.

normalize_ticket(record: dict[str, Any], extra_rows: list[dict[str, Any]] | None = None, stages: dict[int, dict[str, Any]] | None = None, stage_roles: dict[str, int | None] | None = None) -> HelpdeskTicket

Parameter Type Default Description
record dict[str, Any]
extra_rows list[dict[str, Any]] | None None
stages dict[int, dict[str, Any]] | None None
stage_roles dict[str, int | None] | None None

Returns: HelpdeskTicket

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally