Skip to content
Merged
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_export_async/|
^base_import_async/|
^queue_job_cron/|
^queue_job_subscribe/|
^test_base_import_async/|
# END NOT INSTALLABLE ADDONS
Expand Down
2 changes: 1 addition & 1 deletion queue_job/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from . import models
from . import wizards
from . import jobrunner
from .hooks.post_init_hook import post_init_hook
from .post_init_hook import post_init_hook

# shortcuts
from .job import identity_exact
1 change: 0 additions & 1 deletion queue_job/models/queue_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ def autovacuum(self):
)
if jobs:
jobs.unlink()
self.env.cr.commit()
else:
break
return True
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion queue_job/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import mock

from odoo.addons.queue_job.job import Job
from ..job import Job


class JobCounter:
Expand Down
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": "13.0.2.1.0",
"version": "14.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,
}
21 changes: 13 additions & 8 deletions queue_job_cron/models/ir_cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ def _run_job_as_queue_job(self, server_action):
return server_action.run()

def method_direct_trigger(self):
if self.run_as_queue_job:
return self.with_delay(
priority=self.priority,
description=self.name,
channel=self.channel_id.complete_name,
)._run_job_as_queue_job(server_action=self.ir_actions_server_id)
else:
return super().method_direct_trigger()
for cron in self:
if not cron.run_as_queue_job:
super(IrCron, cron).method_direct_trigger()
else:
_cron = cron.with_user(cron.user_id).with_context(
lastcall=cron.lastcall
)
_cron.with_delay(
priority=_cron.priority,
description=_cron.name,
channel=_cron.channel_id.complete_name,
)._run_job_as_queue_job(server_action=_cron.ir_actions_server_id)
return True

def _callback(self, cron_name, server_action_id, job_id):
cron = self.env["ir.cron"].sudo().browse(job_id)
Expand Down
1 change: 1 addition & 0 deletions setup/queue_job_cron/odoo/addons/queue_job_cron
6 changes: 6 additions & 0 deletions setup/queue_job_cron/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)