Skip to content
Merged
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
29 changes: 29 additions & 0 deletions queue_job/migrations/10.0.1.0.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


def migrate(cr, version):
if not version:
return
# In order to migrate connector from v9 to v10, we need to set
# connector module state to 'to upgrade'. If this is not done, all
# connector.* xmlids are removed due to the module renaming done by
# OpenUpgrade. In the future the approach sketched in
# https://github.com/OCA/queue/pull/23#issuecomment-325706811
# may provide a more generic solution.
cr.execute("""
UPDATE ir_module_module
SET state='to upgrade'
WHERE name='connector'
""")
try:
from openupgradelib import openupgrade
openupgrade.rename_xmlids(
cr, [
('queue_job.group_connector_manager',
'queue_job.group_queue_job_manager',)
],
)
except ImportError:
pass