Skip to content

Commit 10395fd

Browse files
baguenthAnizR
authored andcommitted
[FIX] queue_job: Adapted migration to properly delete the invalid cron job
1 parent 5aaf399 commit 10395fd

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
2+
from openupgradelib import openupgrade
23

34

4-
def migrate(cr, version):
5-
# Deactivate cron garbage collector
6-
cr.execute(
7-
"""
8-
UPDATE
9-
ir_cron
10-
SET
11-
active=False
12-
WHERE id IN (
13-
SELECT res_id
14-
FROM
15-
ir_model_data
16-
WHERE
17-
module='queue_job'
18-
AND model='ir.cron'
19-
AND name='ir_cron_queue_job_garbage_collector'
20-
);
21-
"""
5+
@openupgrade.migrate()
6+
def migrate(env, version):
7+
# Remove cron garbage collector
8+
openupgrade.delete_records_safely_by_xml_id(
9+
env,
10+
["queue_job.ir_cron_queue_job_garbage_collector"],
2211
)

0 commit comments

Comments
 (0)