Async Auth¶
Async authentication utilities and requested-author message operations. Cross-user attribution requires an internal authenticated user. Odoo may reject or override it for share users, which can reliably attribute only to their own partner. Selecting an author does not change authenticated identity, access checks, or auditing.
auth
¶
Async authentication utilities for Vodoo.
Mirrors :mod:vodoo.auth with async methods.
get_default_user_id
async
¶
get_default_user_id(client: AsyncOdooClient, username: str | None = None) -> int
Get the default requested-author user ID for message operations.
| PARAMETER | DESCRIPTION |
|---|---|
client
|
Async Odoo client
TYPE:
|
username
|
Username to search for (defaults to configured username)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
User ID |
| RAISES | DESCRIPTION |
|---|---|
RecordNotFoundError
|
If user not found |
Source code in src/vodoo/aio/auth.py
get_partner_id_from_user
async
¶
get_partner_id_from_user(client: AsyncOdooClient, user_id: int) -> int
Get the partner ID associated with a user.
| PARAMETER | DESCRIPTION |
|---|---|
client
|
Async Odoo client
TYPE:
|
user_id
|
User ID (res.users)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Partner ID (res.partner) |
| RAISES | DESCRIPTION |
|---|---|
RecordNotFoundError
|
If user not found or has no partner |
Source code in src/vodoo/aio/auth.py
message_post_sudo
async
¶
message_post_sudo(client: AsyncOdooClient, model: str, res_id: int, body: str, user_id: int | None = None, message_type: str = 'comment', is_note: bool = False, **kwargs: Any) -> bool
Post a message or note requesting a specific displayed author.
Cross-user attribution requires an internal authenticated user. Odoo may reject or override it for share users, which can reliably attribute only to their own partner. This does not change the authenticated identity, access checks, or auditing.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if successful |
Source code in src/vodoo/aio/auth.py
message_post_sudo_with_id
async
¶
message_post_sudo_with_id(client: AsyncOdooClient, model: str, res_id: int, body: str, user_id: int | None = None, message_type: str = 'comment', is_note: bool = False, **kwargs: Any) -> int
Post requesting a specific displayed author and return the message ID.
Cross-user attribution requires an internal authenticated user. Odoo may reject or override it for share users, which can reliably attribute only to their own partner. This does not change the authenticated identity, access checks, or auditing.
| PARAMETER | DESCRIPTION |
|---|---|
client
|
Async Odoo client
TYPE:
|
model
|
Model name (e.g., 'helpdesk.ticket')
TYPE:
|
res_id
|
Record ID
TYPE:
|
body
|
Message body (HTML)
TYPE:
|
user_id
|
User whose partner is requested as author (uses default if None)
TYPE:
|
message_type
|
Type of message ('comment' or 'notification')
TYPE:
|
is_note
|
If True, creates an internal note
TYPE:
|
**kwargs
|
Additional arguments for message_post
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
ID of the created |
| RAISES | DESCRIPTION |
|---|---|
ConfigurationError
|
If no default user configured |