Skip to content

Commit 8b0db71

Browse files
committed
[MIG] base_cron_exclusion: Migration to 19.0
1 parent 185e8d6 commit 8b0db71

File tree

4 files changed

+35
-24
lines changed

4 files changed

+35
-24
lines changed

base_cron_exclusion/README.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
===================
26
Base Cron Exclusion
37
===================
@@ -13,17 +17,17 @@ Base Cron Exclusion
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Production/Stable
16-
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1822
:alt: License: LGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
20-
:target: https://github.com/OCA/server-tools/tree/18.0/base_cron_exclusion
24+
:target: https://github.com/OCA/server-tools/tree/19.0/base_cron_exclusion
2125
:alt: OCA/server-tools
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_cron_exclusion
27+
:target: https://translation.odoo-community.org/projects/server-tools-19-0/server-tools-19-0-base_cron_exclusion
2428
:alt: Translate me on Weblate
2529
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=19.0
2731
:alt: Try me on Runboat
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -54,7 +58,7 @@ Bug Tracker
5458
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
5559
In case of trouble, please check there if your issue has already been reported.
5660
If you spotted it first, help us to smash it by providing a detailed and welcomed
57-
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_cron_exclusion%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
61+
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_cron_exclusion%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5862

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

@@ -107,6 +111,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
107111

108112
|maintainer-LoisRForgeFlow| |maintainer-ChrisOForgeFlow|
109113

110-
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/18.0/base_cron_exclusion>`_ project on GitHub.
114+
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/19.0/base_cron_exclusion>`_ project on GitHub.
111115

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

base_cron_exclusion/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "Base Cron Exclusion",
66
"summary": "Allow you to select scheduled actions that should not run "
77
"simultaneously.",
8-
"version": "18.0.1.0.1",
8+
"version": "19.0.1.0.0",
99
"author": "ForgeFlow, Odoo Community Association (OCA)",
1010
"maintainers": ["LoisRForgeFlow", "ChrisOForgeFlow"],
1111
"development_status": "Production/Stable",

base_cron_exclusion/models/ir_cron.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import logging
55

6-
from odoo import api, fields, models
6+
from odoo import api, fields, models, sql_db
77
from odoo.exceptions import ValidationError
88

99
_logger = logging.getLogger(__name__)
@@ -32,6 +32,7 @@ def _check_auto_exclusion(self):
3232

3333
@staticmethod
3434
def _lock_mutually_exclusive_cron(db, job_id):
35+
db = sql_db.db_connect(db)
3536
lock_cr = db.cursor()
3637
lock_cr.execute(
3738
"""
@@ -59,10 +60,10 @@ def _lock_mutually_exclusive_cron(db, job_id):
5960
return lock_cr
6061

6162
@classmethod
62-
def _process_job(cls, db, cron_cr, job):
63-
locked_crons = cls._lock_mutually_exclusive_cron(db, job["id"])
63+
def _process_job(cls, cron_cr, job) -> None:
64+
locked_crons = cls._lock_mutually_exclusive_cron(cron_cr.dbname, job["id"])
6465
try:
65-
res = super()._process_job(db, cron_cr, job)
66+
res = super()._process_job(cron_cr, job)
6667
finally:
6768
locked_crons.close()
6869
_logger.debug("released blocks for cron job %s", job["cron_name"])

base_cron_exclusion/static/description/index.html

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Base Cron Exclusion</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="base-cron-exclusion">
364-
<h1 class="title">Base Cron Exclusion</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="base-cron-exclusion">
370+
<h1>Base Cron Exclusion</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:e2cf1e9e142b4df25319ffe32517d93d3df441b7a8564b97d3c17784bab99f6c
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/18.0/base_cron_exclusion"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_cron_exclusion"><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/server-tools&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/19.0/base_cron_exclusion"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-19-0/server-tools-19-0-base_cron_exclusion"><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/server-tools&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>This module extends the functionality of scheduled actions to allow you
374379
to select the ones that should not run simultaneously.</p>
375380
<p><strong>Table of contents</strong></p>
@@ -387,7 +392,7 @@ <h1 class="title">Base Cron Exclusion</h1>
387392
</ul>
388393
</div>
389394
<div class="section" id="usage">
390-
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
395+
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
391396
<p>To use this module, you need to:</p>
392397
<ol class="arabic simple">
393398
<li>Go to <em>Settings &gt; Technical &gt; Automation &gt; Scheduled Actions</em>.</li>
@@ -399,23 +404,23 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
399404
</ol>
400405
</div>
401406
<div class="section" id="bug-tracker">
402-
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
407+
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
403408
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-tools/issues">GitHub Issues</a>.
404409
In case of trouble, please check there if your issue has already been reported.
405410
If you spotted it first, help us to smash it by providing a detailed and welcomed
406-
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20base_cron_exclusion%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
411+
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20base_cron_exclusion%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
407412
<p>Do not contact contributors directly about support or help with technical issues.</p>
408413
</div>
409414
<div class="section" id="credits">
410-
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
415+
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
411416
<div class="section" id="authors">
412-
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
417+
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
413418
<ul class="simple">
414419
<li>ForgeFlow</li>
415420
</ul>
416421
</div>
417422
<div class="section" id="contributors">
418-
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
423+
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
419424
<ul class="simple">
420425
<li>Christopher Ormaza &lt;<a class="reference external" href="mailto:chris.ormaza&#64;forgeflow.com">chris.ormaza&#64;forgeflow.com</a>&gt;</li>
421426
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
@@ -428,12 +433,12 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
428433
</ul>
429434
</div>
430435
<div class="section" id="other-credits">
431-
<h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
436+
<h3><a class="toc-backref" href="#toc-entry-6">Other credits</a></h3>
432437
<p>The migration of this module from 17.0 to 18.0 was financially supported
433438
by Camptocamp</p>
434439
</div>
435440
<div class="section" id="maintainers">
436-
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
441+
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
437442
<p>This module is maintained by the OCA.</p>
438443
<a class="reference external image-reference" href="https://odoo-community.org">
439444
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -443,10 +448,11 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
443448
promote its widespread use.</p>
444449
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
445450
<p><a class="reference external image-reference" href="https://github.com/LoisRForgeFlow"><img alt="LoisRForgeFlow" src="https://github.com/LoisRForgeFlow.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/ChrisOForgeFlow"><img alt="ChrisOForgeFlow" src="https://github.com/ChrisOForgeFlow.png?size=40px" /></a></p>
446-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/18.0/base_cron_exclusion">OCA/server-tools</a> project on GitHub.</p>
451+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/19.0/base_cron_exclusion">OCA/server-tools</a> project on GitHub.</p>
447452
<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>
448453
</div>
449454
</div>
450455
</div>
456+
</div>
451457
</body>
452458
</html>

0 commit comments

Comments
 (0)