Skip to content

Commit 6a47170

Browse files
author
Sébastien Alix
committed
queue_job: fix partial index to add 'wait_dependencies' state
1 parent 11ae588 commit 6a47170

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

queue_job/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{
55
"name": "Job Queue",
6-
"version": "14.0.2.3.0",
6+
"version": "14.0.2.3.1",
77
"author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)",
88
"website": "https://github.com/OCA/queue",
99
"license": "LGPL-3",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
2+
3+
from odoo.tools.sql import table_exists
4+
5+
6+
def migrate(cr, version):
7+
if table_exists(cr, "queue_job"):
8+
# Drop index 'queue_job_identity_key_state_partial_index',
9+
# it will be recreated during the update
10+
cr.execute(
11+
"DROP INDEX IF EXISTS queue_job_identity_key_state_partial_index;"
12+
)

queue_job/models/queue_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def init(self):
114114
self._cr.execute(
115115
"CREATE INDEX queue_job_identity_key_state_partial_index "
116116
"ON queue_job (identity_key) WHERE state in ('pending', "
117-
"'enqueued') AND identity_key IS NOT NULL;"
117+
"'enqueued', 'wait_dependencies') AND identity_key IS NOT NULL;"
118118
)
119119

120120
@api.depends("records")

0 commit comments

Comments
 (0)