From 1a16788b1db7ea4e7e15425080c6f9deddeb00a2 Mon Sep 17 00:00:00 2001 From: Adam Heinz Date: Mon, 23 Dec 2024 11:44:38 -0500 Subject: [PATCH 1/2] [FIX] Stop using deprecated odoo.registry function. This avoids a DeprecationWarning introduced in Odoo 17 by https://github.com/odoo/odoo/pull/178784 > WARNING odoo py.warnings: /mnt/extra-addons/oca/queue/queue_job/controllers/main.py:82: DeprecationWarning: Use directly odoo.modules.registry.Registry --- queue_job/controllers/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) From c754edb9b7ed67fe95bd56fabf10c8109cf7fe55 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 27 Dec 2024 09:01:29 +0000 Subject: [PATCH 2/2] [BOT] post-merge updates --- README.md | 2 +- queue_job/README.rst | 2 +- queue_job/__manifest__.py | 2 +- queue_job/static/description/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Job Queue +[queue_job](queue_job/) | 18.0.1.1.2 | [![guewen](https://github.com/guewen.png?size=30px)](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/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 @@

Job Queue

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:a70b92466f87890c5806c5ddded30d2290f2492e47073493ec557672ee6b67b6 +!! source digest: sha256:7e20d0bc521475ff7a942da2a2164d22f8b1bb96282f619fb4791a3535f145df !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Mature License: LGPL-3 OCA/queue Translate me on Weblate Try me on Runboat

This addon adds an integrated Job Queue to Odoo.