diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4cefd00cac..e9b07cb9e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,6 @@ exclude: | # NOT INSTALLABLE ADDONS ^base_import_async/| ^queue_job_batch/| - ^queue_job_cron/| ^queue_job_cron_jobrunner/| ^queue_job_subscribe/| ^test_queue_job_batch/| diff --git a/queue_job_cron/README.rst b/queue_job_cron/README.rst index 9bc2b222bd..c527c3c1bd 100644 --- a/queue_job_cron/README.rst +++ b/queue_job_cron/README.rst @@ -21,13 +21,13 @@ Scheduled Actions as Queue Jobs :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github - :target: https://github.com/OCA/queue/tree/18.0/queue_job_cron + :target: https://github.com/OCA/queue/tree/19.0/queue_job_cron :alt: OCA/queue .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-queue_job_cron + :target: https://translation.odoo-community.org/projects/queue-19-0/queue-19-0-queue_job_cron :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=18.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=19.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -71,17 +71,17 @@ Changelog Features ~~~~~~~~ -- By default prevent parallel run of the same cron job when run as queue - job. +- By default prevent parallel run of the same cron job when run as + queue job. - When a cron job is run by odoo, the odoo runner will prevent parallel - run of the same cron job. Before this change, this was not the case - when the cron job was run as a queue job. A new option is added to the - cron job when run as a queue job to prevent parallel run. This option - is set to True by default. In this way, the behavior is now the same - as when the cron job is run by odoo but you keep the possibility to - disable this restriction when run as a queue job. - (`#612 `__) + When a cron job is run by odoo, the odoo runner will prevent parallel + run of the same cron job. Before this change, this was not the case + when the cron job was run as a queue job. A new option is added to + the cron job when run as a queue job to prevent parallel run. This + option is set to True by default. In this way, the behavior is now + the same as when the cron job is run by odoo but you keep the + possibility to disable this restriction when run as a queue job. + (`#612 `__) Bug Tracker =========== @@ -89,7 +89,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -104,10 +104,10 @@ Authors Contributors ------------ -- Cédric Pigeon -- Nguyen Minh Chien -- Tran Quoc duong -- Vo Hong Thien +- Cédric Pigeon +- Nguyen Minh Chien +- Tran Quoc duong +- Vo Hong Thien Other credits ------------- @@ -128,6 +128,6 @@ 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. -This module is part of the `OCA/queue `_ project on GitHub. +This module is part of the `OCA/queue `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/queue_job_cron/__manifest__.py b/queue_job_cron/__manifest__.py index 5d14b5d602..4e21325fd0 100644 --- a/queue_job_cron/__manifest__.py +++ b/queue_job_cron/__manifest__.py @@ -3,12 +3,12 @@ { "name": "Scheduled Actions as Queue Jobs", - "version": "18.0.1.1.1", + "version": "19.0.1.0.0", "author": "ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/queue", "license": "AGPL-3", "category": "Generic Modules", "depends": ["queue_job"], "data": ["data/data.xml", "views/ir_cron_view.xml"], - "installable": False, + "installable": True, } diff --git a/queue_job_cron/static/description/index.html b/queue_job_cron/static/description/index.html index 563795213e..2ade2e819a 100644 --- a/queue_job_cron/static/description/index.html +++ b/queue_job_cron/static/description/index.html @@ -374,7 +374,7 @@

Scheduled Actions as Queue Jobs

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:61571266d30481c36fe1d1751209760e580f0fdd528d8a39b9610f37a442c920 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module extends the functionality of queue_job and allows to run an Odoo cron as a queue job.

Table of contents

@@ -425,15 +425,15 @@

18.0.1.1.0 (2025-01-16)

Features

    -
  • By default prevent parallel run of the same cron job when run as queue -job.

    +
  • By default prevent parallel run of the same cron job when run as +queue job.

    When a cron job is run by odoo, the odoo runner will prevent parallel run of the same cron job. Before this change, this was not the case -when the cron job was run as a queue job. A new option is added to the -cron job when run as a queue job to prevent parallel run. This option -is set to True by default. In this way, the behavior is now the same -as when the cron job is run by odoo but you keep the possibility to -disable this restriction when run as a queue job. +when the cron job was run as a queue job. A new option is added to +the cron job when run as a queue job to prevent parallel run. This +option is set to True by default. In this way, the behavior is now +the same as when the cron job is run by odoo but you keep the +possibility to disable this restriction when run as a queue job. (#612)

@@ -445,7 +445,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -479,7 +479,7 @@

Maintainers

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.

-

This module is part of the OCA/queue project on GitHub.

+

This module is part of the OCA/queue project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/queue_job_cron/tests/test_queue_job_cron.py b/queue_job_cron/tests/test_queue_job_cron.py index 8457ef404d..afb98e4442 100644 --- a/queue_job_cron/tests/test_queue_job_cron.py +++ b/queue_job_cron/tests/test_queue_job_cron.py @@ -1,5 +1,7 @@ # Copyright 2019 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from unittest.mock import patch + from odoo.tests.common import TransactionCase @@ -73,7 +75,14 @@ def test_queue_job_cron_callback(self): } ) cron = self.env.ref("queue_job.ir_cron_autovacuum_queue_jobs") - cron._callback("Test queue job cron", action.id) + # In Odoo 19 the base `_callback` commits/rolls back the cursor, which + # is forbidden inside a TransactionCase; bypass that on the + # super-delegating path so we can still assert it ran the action. + with ( + patch.object(self.env.cr, "commit"), + patch.object(self.env.cr, "rollback"), + ): + cron._callback("Test queue job cron", action.id) nb_partners_after_cron = self.env["res.partner"].search_count([]) self.assertEqual(nb_partners_after_cron, nb_partners + 1) cron.write({"run_as_queue_job": True})