diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index 56129042c0..3b3caae4aa 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -2,7 +2,7 @@ { "name": "Job Queue", - "version": "14.0.3.5.1", + "version": "14.0.3.5.2", "author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/queue", "license": "LGPL-3", diff --git a/queue_job/migrations/14.0.3.5.2/pre-migration.py b/queue_job/migrations/14.0.3.5.2/pre-migration.py new file mode 100644 index 0000000000..7a2bca2e07 --- /dev/null +++ b/queue_job/migrations/14.0.3.5.2/pre-migration.py @@ -0,0 +1,12 @@ +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html) + +from odoo.tools.sql import table_exists + + +def migrate(cr, version): + if table_exists(cr, "queue_job"): + # Drop index 'queue_job_identity_key_state_partial_index', + # it will be recreated during the update + cr.execute( + "DROP INDEX IF EXISTS queue_job_identity_key_state_partial_index;" + ) diff --git a/queue_job/models/queue_job.py b/queue_job/models/queue_job.py index 791c54db13..03aa60d60d 100644 --- a/queue_job/models/queue_job.py +++ b/queue_job/models/queue_job.py @@ -139,7 +139,7 @@ def init(self): self._cr.execute( "CREATE INDEX queue_job_identity_key_state_partial_index " "ON queue_job (identity_key) WHERE state in ('pending', " - "'enqueued') AND identity_key IS NOT NULL;" + "'enqueued', 'wait_dependencies') AND identity_key IS NOT NULL;" ) @api.depends("records")