From f0cc9b2eb91e145ebd164a969a4d4adc4d5ad310 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sat, 28 Feb 2026 02:08:04 -0500 Subject: [PATCH] [IMP] script todo feature debug file todo.py --- script/todo/todo.py | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/script/todo/todo.py b/script/todo/todo.py index 422ebb7..ba6372d 100755 --- a/script/todo/todo.py +++ b/script/todo/todo.py @@ -600,6 +600,12 @@ class TODO: } lst_choice.append(dct_upgrade_odoo_database) + lst_choice.append( + { + "prompt_description": "Debug", + } + ) + help_info = self.fill_help_info(lst_choice) while True: @@ -608,8 +614,10 @@ class TODO: if status == "0": return False elif status == str(len(lst_choice)): - self.upgrade_module() + self.debug_ide() elif status == str(len(lst_choice) - 1): + self.upgrade_module() + elif status == str(len(lst_choice) - 2): self.open_shell_on_database() else: cmd_no_found = True @@ -791,6 +799,25 @@ class TODO: else: print("Commande non trouvée 🤖!") + def debug_ide(self): + lst_choice = [ + {"prompt_description": "Debug todo.py"}, + ] + help_info = self.fill_help_info(lst_choice) + + while True: + status = click.prompt(help_info) + print() + if status == "0": + return False + elif status == "1": + self.open_pycharm_file( + os.getcwd(), + os.path.join(os.getcwd(), "script/todo/todo.py"), + ) + else: + print("Commande non trouvée 🤖!") + def generate_config_from_backup(self): file_name = self.open_file_image_db() add_arg = f"--from_backup_name {file_name} --add_repo odoo18.0/addons/MathBenTech_development" @@ -994,6 +1021,17 @@ class TODO: new_window=True, ) + def open_pycharm_file(self, folder, filename): + cmd = "~/.local/share/JetBrains/Toolbox/scripts/pycharm" + # cmd = "/snap/bin/pycharm-community" + # if pycharm_arg: + # cmd += f" {pycharm_arg}" + if folder: + cmd += f" {folder}" + if filename: + cmd += f" --line 1 {filename}" + self.execute.exec_command_live(cmd, source_erplibre=False) + def upgrade_module(self): upgrade = todo_upgrade.TodoUpgrade(self) upgrade.execute_module_upgrade()