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

36 lines
1.1 KiB
Python

from menu_handlers import (
handle_list_models,
handle_list_model_fields,
handle_export_model_fields_to_json,
handle_project_tickets_by_stage
)
def display_main_menu():
"""Affiche le menu principal de l'application"""
print("\n==== GESTIONNAIRE DE TICKETS ODOO ====")
print("1. Afficher la liste des modèles")
print("2. Afficher les champs d'un modèle")
print("3. Exporter les informations des champs d'un modèle en JSON")
print("4. Exporter les tickets d'un project_id par étape")
print("5. Quitter")
return input("\nChoisissez une option (1-5): ")
def run_menu():
"""Exécute la boucle du menu principal"""
while True:
choice = display_main_menu()
if choice == '1':
handle_list_models()
elif choice == '2':
handle_list_model_fields()
elif choice == '3':
handle_export_model_fields_to_json()
elif choice == '4':
handle_project_tickets_by_stage()
elif choice == '5':
print("Au revoir!")
break
else:
print("Option invalide. Veuillez choisir entre 1 et 5.")