Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/|
Expand Down
38 changes: 19 additions & 19 deletions queue_job_cron/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -71,25 +71,25 @@ 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 <https://github.com/OCA/queue/issues/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 <https://github.com/OCA/queue/issues/612>`__)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/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 <https://github.com/OCA/queue/issues/new?body=module:%20queue_job_cron%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20queue_job_cron%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand All @@ -104,10 +104,10 @@ Authors
Contributors
------------

- Cédric Pigeon <cedric.pigeon@acsone.eu>
- Nguyen Minh Chien <chien@trobz.com>
- Tran Quoc duong <duongtq@trobz.com>
- Vo Hong Thien <thienvh@trobz.com>
- Cédric Pigeon <cedric.pigeon@acsone.eu>
- Nguyen Minh Chien <chien@trobz.com>
- Tran Quoc duong <duongtq@trobz.com>
- Vo Hong Thien <thienvh@trobz.com>

Other credits
-------------
Expand All @@ -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 <https://github.com/OCA/queue/tree/18.0/queue_job_cron>`_ project on GitHub.
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/19.0/queue_job_cron>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions queue_job_cron/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
20 changes: 10 additions & 10 deletions queue_job_cron/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ <h1>Scheduled Actions as Queue Jobs</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:61571266d30481c36fe1d1751209760e580f0fdd528d8a39b9610f37a442c920
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/18.0/queue_job_cron"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-queue_job_cron"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/queue&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/19.0/queue_job_cron"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/queue-19-0/queue-19-0-queue_job_cron"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/queue&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of queue_job and allows to run an
Odoo cron as a queue job.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -425,15 +425,15 @@ <h3><a class="toc-backref" href="#toc-entry-4">18.0.1.1.0 (2025-01-16)</a></h3>
<div class="section" id="features">
<h4><a class="toc-backref" href="#toc-entry-5">Features</a></h4>
<ul>
<li><p class="first">By default prevent parallel run of the same cron job when run as queue
job.</p>
<li><p class="first">By default prevent parallel run of the same cron job when run as
queue job.</p>
<p>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.
(<a class="reference external" href="https://github.com/OCA/queue/issues/612">#612</a>)</p>
</li>
</ul>
Expand All @@ -445,7 +445,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/queue/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20queue_job_cron%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20queue_job_cron%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -479,7 +479,7 @@ <h3><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h3>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/18.0/queue_job_cron">OCA/queue</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/19.0/queue_job_cron">OCA/queue</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
11 changes: 10 additions & 1 deletion queue_job_cron/tests/test_queue_job_cron.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from unittest.mock import patch

from odoo.tests.common import TransactionCase


Expand Down Expand Up @@ -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})
Expand Down
Loading