Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0] fix dependancies jobs #145

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions saas/models/saas_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
11 changes: 4 additions & 7 deletions saas/models/saas_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down