mirror of
https://github.com/Ladebeze66/llm_ticket3.git
synced 2025-12-16 03:47:49 +01:00
16 lines
564 B
Python
16 lines
564 B
Python
from typing import List, Dict, Any
|
|
from .auth_manager import AuthManager
|
|
|
|
class AttachmentManager:
|
|
def __init__(self, auth: AuthManager):
|
|
self.auth = auth
|
|
|
|
def get_ticket_attachments(self, ticket_id: int) -> List[Dict[str, Any]]:
|
|
params = {
|
|
"model": "ir.attachment",
|
|
"method": "search_read",
|
|
"args": [[[ "res_id", "=", ticket_id], ["res_model", "=", "project.task"]]],
|
|
"kwargs": {"fields": ["id", "name", "datas"]}
|
|
}
|
|
return self.auth._rpc_call("/web/dataset/call_kw", params)
|