From ad4f54dfc51dbca1a0d8044887c73f3f38b44064 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Thu, 27 Jan 2022 11:15:55 +0100 Subject: [PATCH 1/3] [REF] remove explicit 'object' inheritance --- queue_job/delay.py | 2 +- queue_job/job.py | 2 +- queue_job/jobrunner/channels.py | 10 +++++----- queue_job/jobrunner/runner.py | 4 ++-- test_queue_job/tests/test_job.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/queue_job/delay.py b/queue_job/delay.py index d188542ffe..d00736fbe8 100644 --- a/queue_job/delay.py +++ b/queue_job/delay.py @@ -609,7 +609,7 @@ def _execute_direct(self): self._generated_job.perform() -class DelayableRecordset(object): +class DelayableRecordset: """Allow to delay a method for a recordset (shortcut way) Usage:: diff --git a/queue_job/job.py b/queue_job/job.py index 40dc8f1a2e..e486d1f001 100644 --- a/queue_job/job.py +++ b/queue_job/job.py @@ -105,7 +105,7 @@ def identity_exact_hasher(job_): @total_ordering -class Job(object): +class Job: """A Job is a task to execute. It is the in-memory representation of a job. Jobs are stored in the ``queue.job`` Odoo Model, but they are handled diff --git a/queue_job/jobrunner/channels.py b/queue_job/jobrunner/channels.py index e976f36039..3f81ec0b2a 100644 --- a/queue_job/jobrunner/channels.py +++ b/queue_job/jobrunner/channels.py @@ -14,7 +14,7 @@ _logger = logging.getLogger(__name__) -class PriorityQueue(object): +class PriorityQueue: """A priority queue that supports removing arbitrary objects. Adding an object already in the queue is a no op. @@ -103,7 +103,7 @@ def pop(self): @total_ordering -class ChannelJob(object): +class ChannelJob: """A channel job is attached to a channel and holds the properties of a job that are necessary to prioritise them. @@ -205,7 +205,7 @@ def __lt__(self, other): return self.sorting_key() < other.sorting_key() -class ChannelQueue(object): +class ChannelQueue: """A channel queue is a priority queue for jobs. Jobs with an eta are set aside until their eta is past due, at @@ -334,7 +334,7 @@ def get_wakeup_time(self, wakeup_time=0): return wakeup_time -class Channel(object): +class Channel: """A channel for jobs, with a maximum capacity. When jobs are created by queue_job modules, they may be associated @@ -581,7 +581,7 @@ def split_strip(s, sep, maxsplit=-1): return [x.strip() for x in s.split(sep, maxsplit)] -class ChannelManager(object): +class ChannelManager: """High level interface for channels This class handles: diff --git a/queue_job/jobrunner/runner.py b/queue_job/jobrunner/runner.py index 25823a9973..025c228c62 100644 --- a/queue_job/jobrunner/runner.py +++ b/queue_job/jobrunner/runner.py @@ -259,7 +259,7 @@ def urlopen(): thread.start() -class Database(object): +class Database: def __init__(self, db_name): self.db_name = db_name connection_info = _connection_info_for(db_name) @@ -344,7 +344,7 @@ def set_job_enqueued(self, uuid): ) -class QueueJobRunner(object): +class QueueJobRunner: def __init__( self, scheme="http", diff --git a/test_queue_job/tests/test_job.py b/test_queue_job/tests/test_job.py index c36912c6ce..b33c19fafa 100644 --- a/test_queue_job/tests/test_job.py +++ b/test_queue_job/tests/test_job.py @@ -90,7 +90,7 @@ def test_infinite_retryable_error(self): self.assertEqual(test_job.retry, 1) def test_on_instance_method(self): - class A(object): + class A: def method(self): pass From 1ddc4c8cce9fd6ca6c6c59c52708bb1273fa6535 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Thu, 26 Dec 2024 17:28:17 +0100 Subject: [PATCH 2/3] [REF] remove explicit super() arguments --- base_export_async/tests/test_base_export_async.py | 2 +- queue_job/tests/common.py | 2 +- queue_job_subscribe/tests/test_job_subscribe.py | 2 +- test_queue_job/models/test_models.py | 2 +- test_queue_job/tests/test_job.py | 2 +- test_queue_job/tests/test_job_channels.py | 2 +- test_queue_job/tests/test_job_function.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/base_export_async/tests/test_base_export_async.py b/base_export_async/tests/test_base_export_async.py index e1b5c3579a..a241249412 100644 --- a/base_export_async/tests/test_base_export_async.py +++ b/base_export_async/tests/test_base_export_async.py @@ -42,7 +42,7 @@ class TestBaseExportAsync(common.TransactionCase): def setUp(self): - super(TestBaseExportAsync, self).setUp() + super().setUp() self.delay_export_obj = self.env["delay.export"] self.job_obj = self.env["queue.job"] _request_stack.push( diff --git a/queue_job/tests/common.py b/queue_job/tests/common.py index 5039dfc0a5..5ca2f079e7 100644 --- a/queue_job/tests/common.py +++ b/queue_job/tests/common.py @@ -428,7 +428,7 @@ def __init__( def setUp(self): """Log an extra statement which test is started.""" - super(OdooDocTestCase, self).setUp() + super().setUp() logging.getLogger(__name__).info("Running tests for %s", self._dt_test.name) diff --git a/queue_job_subscribe/tests/test_job_subscribe.py b/queue_job_subscribe/tests/test_job_subscribe.py index 0f1fcddf48..935f15f74a 100644 --- a/queue_job_subscribe/tests/test_job_subscribe.py +++ b/queue_job_subscribe/tests/test_job_subscribe.py @@ -8,7 +8,7 @@ class TestJobSubscribe(common.TransactionCase): def setUp(self): - super(TestJobSubscribe, self).setUp() + super().setUp() grp_queue_job_manager = self.ref("queue_job.group_queue_job_manager") self.other_partner_a = self.env["res.partner"].create( {"name": "My Company a", "is_company": True, "email": "test@tes.ttest"} diff --git a/test_queue_job/models/test_models.py b/test_queue_job/models/test_models.py index 573e2380a9..03fa792137 100644 --- a/test_queue_job/models/test_models.py +++ b/test_queue_job/models/test_models.py @@ -76,7 +76,7 @@ def job_with_retry_pattern__no_zero(self): return def mapped(self, func): - return super(ModelTestQueueJob, self).mapped(func) + return super().mapped(func) def job_alter_mutable(self, mutable_arg, mutable_kwarg=None): mutable_arg.append(2) diff --git a/test_queue_job/tests/test_job.py b/test_queue_job/tests/test_job.py index b33c19fafa..0a7bcaeb0e 100644 --- a/test_queue_job/tests/test_job.py +++ b/test_queue_job/tests/test_job.py @@ -651,7 +651,7 @@ class TestJobStorageMultiCompany(common.TransactionCase): """Test storage of jobs""" def setUp(self): - super(TestJobStorageMultiCompany, self).setUp() + super().setUp() self.queue_job = self.env["queue.job"] grp_queue_job_manager = self.ref("queue_job.group_queue_job_manager") User = self.env["res.users"] diff --git a/test_queue_job/tests/test_job_channels.py b/test_queue_job/tests/test_job_channels.py index 1043e9708b..f02c22d158 100644 --- a/test_queue_job/tests/test_job_channels.py +++ b/test_queue_job/tests/test_job_channels.py @@ -9,7 +9,7 @@ class TestJobChannels(common.TransactionCase): def setUp(self): - super(TestJobChannels, self).setUp() + super().setUp() self.function_model = self.env["queue.job.function"] self.channel_model = self.env["queue.job.channel"] self.test_model = self.env["test.queue.channel"] diff --git a/test_queue_job/tests/test_job_function.py b/test_queue_job/tests/test_job_function.py index 17781ac475..320b4973c5 100644 --- a/test_queue_job/tests/test_job_function.py +++ b/test_queue_job/tests/test_job_function.py @@ -4,7 +4,7 @@ class TestJobFunction(common.TransactionCase): def setUp(self): - super(TestJobFunction, self).setUp() + super().setUp() self.test_function_model = self.env.ref( "queue_job.job_function_queue_job__test_job" ) From 81f6262df3d1f5a577bd1e0d21f1cedef48d3fcc Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 28 Jan 2025 10:50:12 +0000 Subject: [PATCH 3/3] [BOT] post-merge updates --- README.md | 8 ++++---- base_export_async/README.rst | 2 +- base_export_async/__manifest__.py | 2 +- base_export_async/static/description/index.html | 14 ++++++++------ queue_job/README.rst | 2 +- queue_job/__manifest__.py | 2 +- queue_job/static/description/index.html | 2 +- queue_job_subscribe/__manifest__.py | 2 +- test_queue_job/__manifest__.py | 2 +- 9 files changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0308bbf69a..b93c251f44 100644 --- a/README.md +++ b/README.md @@ -21,17 +21,17 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[base_export_async](base_export_async/) | 14.0.1.0.0 | | Asynchronous export with job queue +[base_export_async](base_export_async/) | 14.0.1.0.1 | | Asynchronous export with job queue [base_import_async](base_import_async/) | 14.0.1.0.2 | | Import CSV files in the background [export_async_schedule](export_async_schedule/) | 14.0.1.0.1 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Generate and send exports by emails on a schedule -[queue_job](queue_job/) | 14.0.3.9.1 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Job Queue +[queue_job](queue_job/) | 14.0.3.9.2 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Job Queue [queue_job_batch](queue_job_batch/) | 14.0.1.0.2 | | Job Queue Batch [queue_job_context](queue_job_context/) | 14.0.1.0.1 | [![AshishHirapara](https://github.com/AshishHirapara.png?size=30px)](https://github.com/AshishHirapara) | Queue Job, prepare context before enqueue keys [queue_job_cron](queue_job_cron/) | 14.0.2.0.0 | | Scheduled Actions as Queue Jobs [queue_job_cron_jobrunner](queue_job_cron_jobrunner/) | 14.0.1.0.3 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Run jobs without a dedicated JobRunner -[queue_job_subscribe](queue_job_subscribe/) | 14.0.1.0.0 | | Control which users are subscribed to queue job notifications +[queue_job_subscribe](queue_job_subscribe/) | 14.0.1.0.1 | | Control which users are subscribed to queue job notifications [test_base_import_async](test_base_import_async/) | 14.0.1.0.1 | | Test suite for base_import_async. Normally you don't need to install this. -[test_queue_job](test_queue_job/) | 14.0.3.4.0 | | Queue Job Tests +[test_queue_job](test_queue_job/) | 14.0.3.4.1 | | Queue Job Tests [test_queue_job_batch](test_queue_job_batch/) | 14.0.1.0.0 | | Test Job Queue Batch [//]: # (end addons) diff --git a/base_export_async/README.rst b/base_export_async/README.rst index 41ae038af7..728560e90d 100644 --- a/base_export_async/README.rst +++ b/base_export_async/README.rst @@ -7,7 +7,7 @@ Base Export Async !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:e3e8c7e07bf30eeee570423b5cae7488f38e5b5453dc284b61c2713cf4c96ac6 + !! source digest: sha256:cf5f439114cb36f87f48b4aa85cac693381fb78cab92a68f371a98460ca7a38b !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/base_export_async/__manifest__.py b/base_export_async/__manifest__.py index ff3b027fca..a8fc3a36f7 100644 --- a/base_export_async/__manifest__.py +++ b/base_export_async/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Base Export Async", "summary": "Asynchronous export with job queue", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "license": "AGPL-3", "author": "ACSONE SA/NV, Odoo Community Association (OCA)", "website": "https://github.com/OCA/queue", diff --git a/base_export_async/static/description/index.html b/base_export_async/static/description/index.html index 40de9d2ece..42af0bb5fc 100644 --- a/base_export_async/static/description/index.html +++ b/base_export_async/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -367,7 +367,7 @@

Base Export Async

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

Beta License: AGPL-3 OCA/queue Translate me on Weblate Try me on Runboat

Standard Export can be delayed in asynchronous jobs executed in the background and then send by email to the user.

@@ -418,7 +418,9 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

diff --git a/queue_job/README.rst b/queue_job/README.rst index 2027179a3b..9abe7be9fe 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:5ad5d33dbc6873d731aa277b1e53152643175aba30ae399f5b5ee7c64958efa4 + !! source digest: sha256:7548ac634e7444ca933ea5410b86f4c5edef0496361b60dc5232a6a327b74ff0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index 61f2640b89..2d03027fce 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -2,7 +2,7 @@ { "name": "Job Queue", - "version": "14.0.3.9.1", + "version": "14.0.3.9.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 1f96e22622..54ab52616a 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:5ad5d33dbc6873d731aa277b1e53152643175aba30ae399f5b5ee7c64958efa4 +!! source digest: sha256:7548ac634e7444ca933ea5410b86f4c5edef0496361b60dc5232a6a327b74ff0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

This addon adds an integrated Job Queue to Odoo.

diff --git a/queue_job_subscribe/__manifest__.py b/queue_job_subscribe/__manifest__.py index 47971c1b17..f7efa34e3b 100644 --- a/queue_job_subscribe/__manifest__.py +++ b/queue_job_subscribe/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Queue Job Subscribe", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "author": "Acsone SA/NV, Odoo Community Association (OCA)", "website": "https://github.com/OCA/queue", "summary": "Control which users are subscribed to queue job notifications", diff --git a/test_queue_job/__manifest__.py b/test_queue_job/__manifest__.py index 2eab1656b0..354e85304a 100644 --- a/test_queue_job/__manifest__.py +++ b/test_queue_job/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Queue Job Tests", - "version": "14.0.3.4.0", + "version": "14.0.3.4.1", "author": "Camptocamp,Odoo Community Association (OCA)", "license": "LGPL-3", "category": "Generic Modules",