diff --git a/saas/models/saas_operator.py b/saas/models/saas_operator.py index efd061bc..973d03e9 100644 --- a/saas/models/saas_operator.py +++ b/saas/models/saas_operator.py @@ -4,11 +4,13 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from collections import defaultdict import string +import logging import psycopg2 from odoo import models, fields import odoo.addons.saas_cluster_simple.main as cluster from odoo.addons.queue_job.exception import RetryableJobError +_logger = logging.getLogger(__name__) class SAASOperator(models.Model): diff --git a/saas/models/saas_template.py b/saas/models/saas_template.py index 867ce943..fd3a2b4b 100644 --- a/saas/models/saas_template.py +++ b/saas/models/saas_template.py @@ -222,18 +222,15 @@ def create_db(self, key_values=None, db_name=None, with_delay=True, draft_build_ self.env['saas.log'].log_db_creating(build, self.operator_db_id) if with_delay: - job_create = build.with_delay().create_db( + job_create = build.delayable().create_db( self.operator_db_name, self.template_id.template_demo, ) - job_install_modules = group(job_create).on_done( - build.with_delay().action_install_missing_mandatory_modules() - ) + job_install_modules = build.delayable().action_install_missing_mandatory_modules() - group(job_install_modules).on_done( - self.operator_id.with_delay().build_post_init( + job_build_post_init= self.operator_id.delayable().build_post_init( build, self.template_id.build_post_init, key_values ) - ) + job_create.on_done(job_install_modules.on_done(job_build_post_init)).delay() else: build.create_db( self.operator_db_name,