odoo_toolkit/menu_principal.py
2025-03-19 17:23:19 +01:00

43 lines
1.5 KiB
Python

from menu_handlers import (
handle_project_tickets_by_stage,
handle_search_ticket_by_id,
handle_search_ticket_by_code,
handle_list_models,
handle_list_model_fields,
handle_extract_ticket_attachments
)
def display_main_menu():
"""Affiche le menu principal de l'application"""
print("\n==== GESTIONNAIRE DE TICKETS ODOO ====")
print("1. Exporter les tickets par projet et/ou étape")
print("2. Rechercher un ticket par ID")
print("3. Rechercher un ticket par Code")
print("4. Afficher la liste des modèles disponibles")
print("5. Afficher les champs d'un modèle donné")
print("6. Extraire les pièces jointes, messages et informations détaillées d'un ticket")
print("7. Quitter")
return input("\nChoisissez une option (1-7): ")
def run_menu():
"""Exécute la boucle du menu principal"""
while True:
choice = display_main_menu()
if choice == '1':
handle_project_tickets_by_stage()
elif choice == '2':
handle_search_ticket_by_id()
elif choice == '3':
handle_search_ticket_by_code()
elif choice == '4':
handle_list_models()
elif choice == '5':
handle_list_model_fields()
elif choice == '6':
handle_extract_ticket_attachments()
elif choice == '7':
print("Au revoir!")
break
else:
print("Option invalide. Veuillez choisir entre 1 et 7.")