From bb94bdf05be45e1d02e87245a906dcc726bf33b7 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Tue, 18 Apr 2023 17:40:01 +0200 Subject: [PATCH] [IMP] module_analysis : allow to pass a custom domain to the analysis cron. Usefull if we want to analyse the code for uninstalled modules for instance --- module_analysis/models/ir_module_module.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module_analysis/models/ir_module_module.py b/module_analysis/models/ir_module_module.py index 8ff418a37..8e18d28aa 100644 --- a/module_analysis/models/ir_module_module.py +++ b/module_analysis/models/ir_module_module.py @@ -90,8 +90,10 @@ class IrModuleModule(models.Model): self._analyse_code() @api.model - def cron_analyse_code(self): - self.search([("state", "=", "installed")])._analyse_code() + def cron_analyse_code(self, domain=None): + if domain is None: + domain = [("state", "=", "installed")] + self.search(domain)._analyse_code() # Custom Section def _analyse_code(self):