diff --git a/.gitignore b/.gitignore index ff433d5..1654167 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ __pycache__/ # C extensions *.so -config/*.yaml # Distribution / packaging .Python build/ diff --git a/config/settings.yaml b/config/settings.yaml index 4ba30d3..777165d 100644 --- a/config/settings.yaml +++ b/config/settings.yaml @@ -1,25 +1,12 @@ odoo_instances: -- name: "ftacpa" - host: "10.1.1.31" - port: 8069 - database: "ftacpa" - username: "nextzen" - password: "smartyourlife" - type: "systemctl" - service_name: "odoo18" - git: - repo_url: "https://hoangvv:smartyourlife@git.nextzenos.com/NextERP/Odoo18-FTACPA.git" - branch: "community/demo/ftacpa" - local_path: "/opt/odoo18/addons" - ssh: - user: root - password: Smartyourlife123@* - key_path: "/root/.ssh/privatessh.key" -odoo_instances: -- name: "ftacpa" - host: "10.1.1.31" +- name: "server" + host: "10.1.1.34" port: 8069 database: "server" + modules: + - "hr_holidays" + - "timesheet" + - "hr" username: "nextzen" password: "smartyourlife" type: "systemctl" diff --git a/services/odoo/module.py b/services/odoo/module.py index 305f650..10541a8 100644 --- a/services/odoo/module.py +++ b/services/odoo/module.py @@ -66,15 +66,15 @@ class OdooModuleManager: if instance_name and instance["name"] != instance_name: continue color_log.Show("INFO", f"Fetching modules for instance: {instance['name']}") - module_ids = self.config.execute( - instance["name"], - "ir.module.module", - "search_read", - [], - ["name"], - ) - modules.extend([mod["name"] for mod in module_ids]) + if not instance.get("modules"): + color_log.Show( + "WARNING", + f"No modules found for instance {instance['name']}, skipping.", + ) + continue + modules.extend(instance["modules"]) return modules + def install(self, instance_name: str = None, module_names: list = None) -> None: """Install multiple modules for the specified instance(s).""" self._manage_module("install", instance_name, module_names)