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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ addon | version | maintainers | summary
[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 | <a href='https://github.com/guewen'><img src='https://github.com/guewen.png' width='32' height='32' style='border-radius:50%;' alt='guewen'/></a> | Generate and send exports by emails on a schedule
[queue_job](queue_job/) | 14.0.3.11.0 | <a href='https://github.com/guewen'><img src='https://github.com/guewen.png' width='32' height='32' style='border-radius:50%;' alt='guewen'/></a> | Job Queue
[queue_job](queue_job/) | 14.0.3.13.0 | <a href='https://github.com/guewen'><img src='https://github.com/guewen.png' width='32' height='32' style='border-radius:50%;' alt='guewen'/></a> | 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 | <a href='https://github.com/AshishHirapara'><img src='https://github.com/AshishHirapara.png' width='32' height='32' style='border-radius:50%;' alt='AshishHirapara'/></a> | Queue Job, prepare context before enqueue keys
[queue_job_cron](queue_job_cron/) | 14.0.2.0.0 | | Scheduled Actions as Queue Jobs
Expand Down
8 changes: 6 additions & 2 deletions queue_job/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=========
Job Queue
=========
Expand All @@ -7,13 +11,13 @@ Job Queue
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3aacd026b8d46dea0a3a200eecd16eb6592a97b8d31a84e6155481a3e5c223c6
!! source digest: sha256:24bc5746fee55884d7fcb4f867d8d62ab10502eaf019f69ac5b03132c6da088b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Mature
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github
Expand Down
2 changes: 1 addition & 1 deletion queue_job/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "Job Queue",
"version": "14.0.3.11.0",
"version": "14.0.3.13.0",
"author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
"license": "LGPL-3",
Expand Down
5 changes: 5 additions & 0 deletions queue_job/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,11 @@ msgstr ""
msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
5 changes: 5 additions & 0 deletions queue_job/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,11 @@ msgstr ""
msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
5 changes: 5 additions & 0 deletions queue_job/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,11 @@ msgstr "Durata (s)"
msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
5 changes: 5 additions & 0 deletions queue_job/i18n/queue_job.pot
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,11 @@ msgstr ""
msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
5 changes: 5 additions & 0 deletions queue_job/i18n/ro.po
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,11 @@ msgstr ""
msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
5 changes: 5 additions & 0 deletions queue_job/i18n/zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,11 @@ msgstr ""
msgid "Time required to execute this job in seconds. Average when grouped."
msgstr ""

#. module: queue_job
#: model_terms:ir.ui.view,arch_db:queue_job.view_queue_job_search
msgid "Tried many times"
msgstr ""

#. module: queue_job
#: model:ir.model.fields,help:queue_job.field_queue_job__activity_exception_decoration
msgid "Type of the exception activity on record."
Expand Down
52 changes: 29 additions & 23 deletions queue_job/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Job Queue</title>
<title>README.rst</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,16 +360,21 @@
</style>
</head>
<body>
<div class="document" id="job-queue">
<h1 class="title">Job Queue</h1>
<div class="document">


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="job-queue">
<h1>Job Queue</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3aacd026b8d46dea0a3a200eecd16eb6592a97b8d31a84e6155481a3e5c223c6
!! source digest: sha256:24bc5746fee55884d7fcb4f867d8d62ab10502eaf019f69ac5b03132c6da088b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.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/queue/tree/14.0/queue_job"><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-14-0/queue-14-0-queue_job"><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=14.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="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.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/queue/tree/14.0/queue_job"><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-14-0/queue-14-0-queue_job"><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=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon adds an integrated Job Queue to Odoo.</p>
<p>It allows to postpone method calls executed asynchronously.</p>
<p>Jobs are executed in the background by a <tt class="docutils literal">Jobrunner</tt>, in their own transaction.</p>
Expand Down Expand Up @@ -441,11 +446,11 @@ <h1 class="title">Job Queue</h1>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
<p>Be sure to have the <tt class="docutils literal">requests</tt> library.</p>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
<h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
<ul class="simple">
<li>Using environment variables and command line:<ul>
<li>Adjust environment variables (optional):<ul>
Expand Down Expand Up @@ -494,15 +499,15 @@ <h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
</table>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-3">Usage</a></h1>
<h2><a class="toc-backref" href="#toc-entry-3">Usage</a></h2>
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>Go to <tt class="docutils literal">Job Queue</tt> menu</li>
</ol>
<div class="section" id="developers">
<h2><a class="toc-backref" href="#toc-entry-4">Developers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-4">Developers</a></h3>
<div class="section" id="delaying-jobs">
<h3><a class="toc-backref" href="#toc-entry-5">Delaying jobs</a></h3>
<h4><a class="toc-backref" href="#toc-entry-5">Delaying jobs</a></h4>
<p>The fast way to enqueue a job for a method is to use <tt class="docutils literal">with_delay()</tt> on a record
or model:</p>
<pre class="code python literal-block">
Expand Down Expand Up @@ -614,7 +619,7 @@ <h3><a class="toc-backref" href="#toc-entry-5">Delaying jobs</a></h3>
</pre>
</div>
<div class="section" id="enqueing-job-options">
<h3><a class="toc-backref" href="#toc-entry-6">Enqueing Job Options</a></h3>
<h4><a class="toc-backref" href="#toc-entry-6">Enqueing Job Options</a></h4>
<ul class="simple">
<li>priority: default is 10, the closest it is to 0, the faster it will be
executed</li>
Expand All @@ -631,7 +636,7 @@ <h3><a class="toc-backref" href="#toc-entry-6">Enqueing Job Options</a></h3>
</ul>
</div>
<div class="section" id="configure-default-options-for-jobs">
<h3><a class="toc-backref" href="#toc-entry-7">Configure default options for jobs</a></h3>
<h4><a class="toc-backref" href="#toc-entry-7">Configure default options for jobs</a></h4>
<p>In earlier versions, jobs could be configured using the <tt class="docutils literal">&#64;job</tt> decorator.
This is now obsolete, they can be configured using optional <tt class="docutils literal">queue.job.function</tt>
and <tt class="docutils literal">queue.job.channel</tt> XML records.</p>
Expand Down Expand Up @@ -766,7 +771,7 @@ <h3><a class="toc-backref" href="#toc-entry-7">Configure default options for job
without delaying any jobs.</p>
</div>
<div class="section" id="testing">
<h3><a class="toc-backref" href="#toc-entry-8">Testing</a></h3>
<h4><a class="toc-backref" href="#toc-entry-8">Testing</a></h4>
<p><strong>Asserting enqueued jobs</strong></p>
<p>The recommended way to test jobs, rather than running them directly and synchronously is to
split the tests in two parts:</p>
Expand Down Expand Up @@ -886,14 +891,14 @@ <h3><a class="toc-backref" href="#toc-entry-8">Testing</a></h3>
</div>
</div>
<div class="section" id="tips-and-tricks">
<h3><a class="toc-backref" href="#toc-entry-9">Tips and tricks</a></h3>
<h4><a class="toc-backref" href="#toc-entry-9">Tips and tricks</a></h4>
<ul class="simple">
<li><strong>Idempotency</strong> (<a class="reference external" href="https://www.restapitutorial.com/lessons/idempotency.html">https://www.restapitutorial.com/lessons/idempotency.html</a>): The queue_job should be idempotent so they can be retried several times without impact on the data.</li>
<li><strong>The job should test at the very beginning its relevance</strong>: the moment the job will be executed is unknown by design. So the first task of a job should be to check if the related work is still relevant at the moment of the execution.</li>
</ul>
</div>
<div class="section" id="patterns">
<h3><a class="toc-backref" href="#toc-entry-10">Patterns</a></h3>
<h4><a class="toc-backref" href="#toc-entry-10">Patterns</a></h4>
<p>Through the time, two main patterns emerged:</p>
<ol class="arabic simple">
<li>For data exposed to users, a model should store the data and the model should be the creator of the job. The job is kept hidden from the users</li>
Expand All @@ -903,7 +908,7 @@ <h3><a class="toc-backref" href="#toc-entry-10">Patterns</a></h3>
</div>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-11">Known issues / Roadmap</a></h1>
<h2><a class="toc-backref" href="#toc-entry-11">Known issues / Roadmap</a></h2>
<ul class="simple">
<li>After creating a new database or installing <tt class="docutils literal">queue_job</tt> on an
existing database, Odoo must be restarted for the runner to detect it.</li>
Expand All @@ -924,7 +929,7 @@ <h1><a class="toc-backref" href="#toc-entry-11">Known issues / Roadmap</a></h1>
</pre>
</div>
<div class="section" id="changelog">
<h1><a class="toc-backref" href="#toc-entry-12">Changelog</a></h1>
<h2><a class="toc-backref" href="#toc-entry-12">Changelog</a></h2>
<!-- [ The change log. The goal of this file is to help readers
understand changes between version. The primary audience is
end users and integrators. Purely technical changes such as
Expand All @@ -935,7 +940,7 @@ <h1><a class="toc-backref" href="#toc-entry-12">Changelog</a></h1>
forbidden and will likely break the structure of the README.rst
or other documents where this fragment is included. ] -->
<div class="section" id="next">
<h2><a class="toc-backref" href="#toc-entry-13">Next</a></h2>
<h3><a class="toc-backref" href="#toc-entry-13">Next</a></h3>
<ul class="simple">
<li>[ADD] Run jobrunner as a worker process instead of a thread in the main
process (when running with –workers &gt; 0)</li>
Expand All @@ -946,24 +951,24 @@ <h2><a class="toc-backref" href="#toc-entry-13">Next</a></h2>
</div>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-14">Bug Tracker</a></h1>
<h2><a class="toc-backref" href="#toc-entry-14">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%0Aversion:%2014.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">
<h1><a class="toc-backref" href="#toc-entry-15">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-15">Credits</a></h2>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-16">Authors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-16">Authors</a></h3>
<ul class="simple">
<li>Camptocamp</li>
<li>ACSONE SA/NV</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-17">Contributors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-17">Contributors</a></h3>
<ul class="simple">
<li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
<li>Stéphane Bidoul &lt;<a class="reference external" href="mailto:stephane.bidoul&#64;acsone.eu">stephane.bidoul&#64;acsone.eu</a>&gt;</li>
Expand All @@ -980,7 +985,7 @@ <h2><a class="toc-backref" href="#toc-entry-17">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-18">Maintainers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-18">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -995,5 +1000,6 @@ <h2><a class="toc-backref" href="#toc-entry-18">Maintainers</a></h2>
</div>
</div>
</div>
</div>
</body>
</html>
22 changes: 14 additions & 8 deletions queue_job/views/queue_job_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,23 +154,23 @@
decoration-muted="state == 'done'"
>
<field name="name" />
<field name="model_name" />
<field name="model_name" optional="show" />
<field name="state" />
<field name="date_created" />
<field name="eta" />
<field name="eta" optional="show" />
<field
name="eta"
widget="remaining_days"
string="Remaining days to execute"
optional="hide"
/> <!-- pylint: disable=duplicate-xml-fields -->
<field name="date_done" />
<field name="exec_time" />
<field name="date_done" optional="show" />
<field name="exec_time" optional="show" />
<field name="priority" optional="hide" />
<field name="exc_name" />
<field name="exc_message" />
<field name="uuid" />
<field name="channel" />
<field name="exc_name" optional="hide" />
<field name="exc_message" optional="hide" />
<field name="uuid" optional="show" />
<field name="channel" optional="show" />
<field name="company_id" groups="base.group_multi_company" />
</tree>
</field>
Expand Down Expand Up @@ -253,6 +253,12 @@
domain="[('state', '=', 'cancelled')]"
/>
<separator />
<filter
name="retried"
string="Tried many times"
domain="[('retry', '&gt;', 1)]"
/>
<separator />
<filter
name="last_24_hours"
string="Last 24 hours"
Expand Down