diff --git a/README.md b/README.md index b4d0ecb599..719eebaa27 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[queue_job](queue_job/) | 18.0.1.1.1 | [](https://github.com/guewen) | Job Queue +[queue_job](queue_job/) | 18.0.1.1.2 | [](https://github.com/guewen) | Job Queue [queue_job_cron](queue_job_cron/) | 18.0.1.0.0 | | Scheduled Actions as Queue Jobs [queue_job_subscribe](queue_job_subscribe/) | 18.0.1.0.0 | | Control which users are subscribed to queue job notifications [test_queue_job](test_queue_job/) | 18.0.1.0.0 | | Queue Job Tests diff --git a/queue_job/README.rst b/queue_job/README.rst index 75a6422006..8fe8ec405c 100644 --- a/queue_job/README.rst +++ b/queue_job/README.rst @@ -7,7 +7,7 @@ Job Queue !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:a70b92466f87890c5806c5ddded30d2290f2492e47073493ec557672ee6b67b6 + !! source digest: sha256:7e20d0bc521475ff7a942da2a2164d22f8b1bb96282f619fb4791a3535f145df !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index 5acd4e33b9..162386a031 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -2,7 +2,7 @@ { "name": "Job Queue", - "version": "18.0.1.1.1", + "version": "18.0.1.1.2", "author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/queue", "license": "LGPL-3", diff --git a/queue_job/controllers/main.py b/queue_job/controllers/main.py index 13288f03de..15522e7321 100644 --- a/queue_job/controllers/main.py +++ b/queue_job/controllers/main.py @@ -11,7 +11,8 @@ from psycopg2 import OperationalError, errorcodes from werkzeug.exceptions import BadRequest, Forbidden -from odoo import SUPERUSER_ID, _, api, http, registry +from odoo import SUPERUSER_ID, _, api, http +from odoo.modules.registry import Registry from odoo.service.model import PG_CONCURRENCY_ERRORS_TO_RETRY from ..delay import chain, group @@ -79,7 +80,7 @@ def runjob(self, db, job_uuid, **kw): def retry_postpone(job, message, seconds=None): job.env.clear() - with registry(job.env.cr.dbname).cursor() as new_cr: + with Registry(job.env.cr.dbname).cursor() as new_cr: job.env = api.Environment(new_cr, SUPERUSER_ID, {}) job.postpone(result=message, seconds=seconds) job.set_pending(reset_retry=False) @@ -130,7 +131,7 @@ def retry_postpone(job, message, seconds=None): traceback_txt = buff.getvalue() _logger.error(traceback_txt) job.env.clear() - with registry(job.env.cr.dbname).cursor() as new_cr: + with Registry(job.env.cr.dbname).cursor() as new_cr: job.env = job.env(cr=new_cr) vals = self._get_failure_values(job, traceback_txt, orig_exception) job.set_failed(**vals) diff --git a/queue_job/static/description/index.html b/queue_job/static/description/index.html index 69e19fd1d0..05893ddef0 100644 --- a/queue_job/static/description/index.html +++ b/queue_job/static/description/index.html @@ -367,7 +367,7 @@
This addon adds an integrated Job Queue to Odoo.