From 6df39aeef5d70b57796c0f39ece1aadfd2f0d3ed Mon Sep 17 00:00:00 2001 From: Vincent Hatakeyama Date: Fri, 24 Jan 2025 11:32:02 +0100 Subject: [PATCH] [FIX] queue_job: indicate that run_job need a read/write connection Without this fix, if db_replica_host is set, Odoo might pass a readonly database cursor and the FOR UPDATE in the method would fail. --- queue_job/controllers/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/queue_job/controllers/main.py b/queue_job/controllers/main.py index 15522e7321..ee60ca5ca0 100644 --- a/queue_job/controllers/main.py +++ b/queue_job/controllers/main.py @@ -73,7 +73,13 @@ def _enqueue_dependent_jobs(self, env, job): else: break - @http.route("/queue_job/runjob", type="http", auth="none", save_session=False) + @http.route( + "/queue_job/runjob", + type="http", + auth="none", + save_session=False, + readonly=False, + ) def runjob(self, db, job_uuid, **kw): http.request.session.db = db env = http.request.env(user=SUPERUSER_ID)