mirror of
https://github.com/Ladebeze66/odoo_toolkit.git
synced 2025-12-15 19:26:55 +01:00
J5-6
This commit is contained in:
parent
b2a5c1703e
commit
31688639f8
Binary file not shown.
3
exported_tickets/ticket_T10929_raw.json
Normal file
3
exported_tickets/ticket_T10929_raw.json
Normal file
@ -0,0 +1,3 @@
|
||||
[
|
||||
10908
|
||||
]
|
||||
@ -40,7 +40,15 @@ class TicketManager:
|
||||
except Exception as e:
|
||||
print_error(f" Erreur inattendue lors de '{method}' sur '{model}': {e}")
|
||||
return None
|
||||
|
||||
|
||||
def get_model_fields(self, model_name):
|
||||
"""Récupére tous les champs disponibles pour un modèle donné"""
|
||||
fields_info = self._safe_execute(model_name, 'fields_get', [], ['name'])
|
||||
if not fields_info:
|
||||
print_error(f"Impossible de récupérer les champs pour {model_name}")
|
||||
return []
|
||||
return list(fields_info.keys()) #Retourne la liste des champs
|
||||
|
||||
def save_raw_ticket_data(self, ticket_data, filename="raw_ticket_data.json"):
|
||||
"""Sauvegarde les données brutes du ticket dans un fichier JSON"""
|
||||
file_path = os.path.join(EXPORT_DIR, filename)
|
||||
@ -50,7 +58,7 @@ class TicketManager:
|
||||
|
||||
def get_ticket_by_id(self, ticket_id):
|
||||
""" Récupère les détails d'un ticket par son ID et applique le filtre """
|
||||
fields_to_read = ['id', 'name', 'code', 'stage_id', 'project_id', 'date_deadline', 'description', 'message_ids']
|
||||
fields_to_read = self.get_model_fields(self.model_name) #Récupère tous les champs disponibles pour le modèle
|
||||
|
||||
# Récupérer les données du ticket
|
||||
ticket_data = self._safe_execute(self.model_name, 'read', [ticket_id], fields_to_read)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user