[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
pull/2609/head
Florian da Costa 2023-04-18 17:40:01 +02:00
parent 3d2fe98f65
commit bb94bdf05b
1 changed files with 4 additions and 2 deletions

View File

@ -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):