-
-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
748512f
commit 2037538
Showing
4 changed files
with
106 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,11 @@ | |
|
||
/* | ||
:Author: David Goodger ([email protected]) | ||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ | ||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ | ||
:Copyright: This stylesheet has been placed in the public domain. | ||
|
||
Default cascading style sheet for the HTML output of Docutils. | ||
Despite the name, some widely supported CSS2 features are used. | ||
|
||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to | ||
customize this style sheet. | ||
|
@@ -274,7 +275,7 @@ | |
margin-left: 2em ; | ||
margin-right: 2em } | ||
|
||
pre.code .ln { color: grey; } /* line numbers */ | ||
pre.code .ln { color: gray; } /* line numbers */ | ||
pre.code, code { background-color: #eeeeee } | ||
pre.code .comment, code .comment { color: #5C6576 } | ||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } | ||
|
@@ -300,7 +301,7 @@ | |
span.pre { | ||
white-space: pre } | ||
|
||
span.problematic { | ||
span.problematic, pre.problematic { | ||
color: red } | ||
|
||
span.section-subtitle { | ||
|
@@ -366,7 +367,7 @@ <h1 class="title">Job Queue</h1> | |
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:b9e93efc8b0afac10d4666c9b35305aac8ac679488e6ac1ad649adb7bac65f4a | ||
!! source digest: sha256:b8379c2bc14aad086397442fdeecc1e9cc2ce8aa0594147b2059ca748752738f | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> | ||
<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/17.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-17-0/queue-17-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&target_branch=17.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> | ||
|
@@ -414,40 +415,69 @@ <h1 class="title">Job Queue</h1> | |
<p><strong>Table of contents</strong></p> | ||
<div class="contents local topic" id="contents"> | ||
<ul class="simple"> | ||
<li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li> | ||
<li><a class="reference internal" href="#configuration" id="toc-entry-2">Configuration</a></li> | ||
<li><a class="reference internal" href="#usage" id="toc-entry-3">Usage</a><ul> | ||
<li><a class="reference internal" href="#developers" id="toc-entry-4">Developers</a><ul> | ||
<li><a class="reference internal" href="#delaying-jobs" id="toc-entry-5">Delaying jobs</a></li> | ||
<li><a class="reference internal" href="#enqueing-job-options" id="toc-entry-6">Enqueing Job Options</a></li> | ||
<li><a class="reference internal" href="#configure-default-options-for-jobs" id="toc-entry-7">Configure default options for jobs</a></li> | ||
<li><a class="reference internal" href="#testing" id="toc-entry-8">Testing</a></li> | ||
<li><a class="reference internal" href="#tips-and-tricks" id="toc-entry-9">Tips and tricks</a></li> | ||
<li><a class="reference internal" href="#patterns" id="toc-entry-10">Patterns</a></li> | ||
<li><a class="reference internal" href="#use-cases-context" id="toc-entry-1">Use Cases / Context</a></li> | ||
<li><a class="reference internal" href="#installation" id="toc-entry-2">Installation</a></li> | ||
<li><a class="reference internal" href="#configuration" id="toc-entry-3">Configuration</a></li> | ||
<li><a class="reference internal" href="#usage" id="toc-entry-4">Usage</a><ul> | ||
<li><a class="reference internal" href="#developers" id="toc-entry-5">Developers</a><ul> | ||
<li><a class="reference internal" href="#delaying-jobs" id="toc-entry-6">Delaying jobs</a></li> | ||
<li><a class="reference internal" href="#enqueing-job-options" id="toc-entry-7">Enqueing Job Options</a></li> | ||
<li><a class="reference internal" href="#configure-default-options-for-jobs" id="toc-entry-8">Configure default options for jobs</a></li> | ||
<li><a class="reference internal" href="#testing" id="toc-entry-9">Testing</a></li> | ||
<li><a class="reference internal" href="#tips-and-tricks" id="toc-entry-10">Tips and tricks</a></li> | ||
<li><a class="reference internal" href="#patterns" id="toc-entry-11">Patterns</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-11">Known issues / Roadmap</a></li> | ||
<li><a class="reference internal" href="#changelog" id="toc-entry-12">Changelog</a><ul> | ||
<li><a class="reference internal" href="#next" id="toc-entry-13">Next</a></li> | ||
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-12">Known issues / Roadmap</a></li> | ||
<li><a class="reference internal" href="#changelog" id="toc-entry-13">Changelog</a><ul> | ||
<li><a class="reference internal" href="#next" id="toc-entry-14">Next</a></li> | ||
</ul> | ||
</li> | ||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-14">Bug Tracker</a></li> | ||
<li><a class="reference internal" href="#credits" id="toc-entry-15">Credits</a><ul> | ||
<li><a class="reference internal" href="#authors" id="toc-entry-16">Authors</a></li> | ||
<li><a class="reference internal" href="#contributors" id="toc-entry-17">Contributors</a></li> | ||
<li><a class="reference internal" href="#maintainers" id="toc-entry-18">Maintainers</a></li> | ||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-15">Bug Tracker</a></li> | ||
<li><a class="reference internal" href="#credits" id="toc-entry-16">Credits</a><ul> | ||
<li><a class="reference internal" href="#authors" id="toc-entry-17">Authors</a></li> | ||
<li><a class="reference internal" href="#contributors" id="toc-entry-18">Contributors</a></li> | ||
<li><a class="reference internal" href="#maintainers" id="toc-entry-19">Maintainers</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="section" id="use-cases-context"> | ||
<h1><a class="toc-backref" href="#toc-entry-1">Use Cases / Context</a></h1> | ||
<p>Odoo treats task synchronously, like when you import a list of products | ||
it will treat each line in one big task. “Queue job” gives you the | ||
ability to detail big tasks in many smaller ones.</p> | ||
<p>Imagine you have a lot of data to change for thousand orders, you can do | ||
it in one step and cause a heavy load on the server, and this may affect | ||
the performance of Odoo. With queue_job you can divide the work in jobs | ||
and run thousand jobs (one job for each orders). An other benefit is if | ||
one line failed it doesn’t block the processing of the others, as the | ||
jobs are independent. Plus you can schedule the jobs and set a number of | ||
retries.</p> | ||
<p>Here are some community usage examples:</p> | ||
<ul class="simple"> | ||
<li>Mass sending invoices: | ||
<a class="reference external" href="https://github.com/OCA/account-invoicing/tree/17.0/account_invoice_mass_sending">account_invoice_mass_sending</a></li> | ||
<li>Import data in the background: | ||
<a class="reference external" href="https://github.com/OCA/queue/tree/17.0/base_import_async">base_import_async</a></li> | ||
<li>Export data in the background: | ||
<a class="reference external" href="https://github.com/OCA/queue/tree/17.0/base_export_async">base_export_async</a></li> | ||
<li>Generate contract invoices with jobs: | ||
<a class="reference external" href="https://github.com/OCA/contract/tree/17.0/contract_queue_job">contract_queue_job</a></li> | ||
<li>Generate partner invoices with | ||
jobs:<a class="reference external" href="https://github.com/OCA/account-invoicing/tree/17.0/partner_invoicing_mode">partner_invoicing_mode</a></li> | ||
<li>Process the Sales Automatic Workflow actions with jobs: | ||
<a class="reference external" href="https://github.com/OCA/sale-workflow/tree/17.0/sale_automatic_workflow_job">sale_automatic_workflow_job</a></li> | ||
</ul> | ||
</div> | ||
<div class="section" id="installation"> | ||
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1> | ||
<h1><a class="toc-backref" href="#toc-entry-2">Installation</a></h1> | ||
<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> | ||
<h1><a class="toc-backref" href="#toc-entry-3">Configuration</a></h1> | ||
<ul class="simple"> | ||
<li>Using environment variables and command line:<ul> | ||
<li>Adjust environment variables (optional):<ul> | ||
|
@@ -497,15 +527,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> | ||
<h1><a class="toc-backref" href="#toc-entry-4">Usage</a></h1> | ||
<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> | ||
<h2><a class="toc-backref" href="#toc-entry-5">Developers</a></h2> | ||
<div class="section" id="delaying-jobs"> | ||
<h3><a class="toc-backref" href="#toc-entry-5">Delaying jobs</a></h3> | ||
<h3><a class="toc-backref" href="#toc-entry-6">Delaying jobs</a></h3> | ||
<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"> | ||
|
@@ -596,7 +626,7 @@ <h3><a class="toc-backref" href="#toc-entry-5">Delaying jobs</a></h3> | |
would be shown).</p> | ||
</div> | ||
<div class="section" id="enqueing-job-options"> | ||
<h3><a class="toc-backref" href="#toc-entry-6">Enqueing Job Options</a></h3> | ||
<h3><a class="toc-backref" href="#toc-entry-7">Enqueing Job Options</a></h3> | ||
<ul class="simple"> | ||
<li>priority: default is 10, the closest it is to 0, the faster it will | ||
be executed</li> | ||
|
@@ -615,7 +645,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> | ||
<h3><a class="toc-backref" href="#toc-entry-8">Configure default options for jobs</a></h3> | ||
<p>In earlier versions, jobs could be configured using the <tt class="docutils literal">@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> | ||
|
@@ -743,7 +773,7 @@ <h3><a class="toc-backref" href="#toc-entry-7">Configure default options for job | |
delaying any jobs.</p> | ||
</div> | ||
<div class="section" id="testing"> | ||
<h3><a class="toc-backref" href="#toc-entry-8">Testing</a></h3> | ||
<h3><a class="toc-backref" href="#toc-entry-9">Testing</a></h3> | ||
<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> | ||
|
@@ -858,7 +888,7 @@ <h3><a class="toc-backref" href="#toc-entry-8">Testing</a></h3> | |
synchronously</p> | ||
</div> | ||
<div class="section" id="tips-and-tricks"> | ||
<h3><a class="toc-backref" href="#toc-entry-9">Tips and tricks</a></h3> | ||
<h3><a class="toc-backref" href="#toc-entry-10">Tips and tricks</a></h3> | ||
<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 | ||
|
@@ -871,7 +901,7 @@ <h3><a class="toc-backref" href="#toc-entry-9">Tips and tricks</a></h3> | |
</ul> | ||
</div> | ||
<div class="section" id="patterns"> | ||
<h3><a class="toc-backref" href="#toc-entry-10">Patterns</a></h3> | ||
<h3><a class="toc-backref" href="#toc-entry-11">Patterns</a></h3> | ||
<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 | ||
|
@@ -885,7 +915,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> | ||
<h1><a class="toc-backref" href="#toc-entry-12">Known issues / Roadmap</a></h1> | ||
<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 | ||
|
@@ -907,9 +937,9 @@ <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> | ||
<h1><a class="toc-backref" href="#toc-entry-13">Changelog</a></h1> | ||
<div class="section" id="next"> | ||
<h2><a class="toc-backref" href="#toc-entry-13">Next</a></h2> | ||
<h2><a class="toc-backref" href="#toc-entry-14">Next</a></h2> | ||
<ul class="simple"> | ||
<li>[ADD] Run jobrunner as a worker process instead of a thread in the | ||
main process (when running with –workers > 0)</li> | ||
|
@@ -920,24 +950,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> | ||
<h1><a class="toc-backref" href="#toc-entry-15">Bug Tracker</a></h1> | ||
<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:%2017.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> | ||
<h1><a class="toc-backref" href="#toc-entry-16">Credits</a></h1> | ||
<div class="section" id="authors"> | ||
<h2><a class="toc-backref" href="#toc-entry-16">Authors</a></h2> | ||
<h2><a class="toc-backref" href="#toc-entry-17">Authors</a></h2> | ||
<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> | ||
<h2><a class="toc-backref" href="#toc-entry-18">Contributors</a></h2> | ||
<ul class="simple"> | ||
<li>Guewen Baconnier <<a class="reference external" href="mailto:guewen.baconnier@camptocamp.com">guewen.baconnier@camptocamp.com</a>></li> | ||
<li>Stéphane Bidoul <<a class="reference external" href="mailto:stephane.bidoul@acsone.eu">stephane.bidoul@acsone.eu</a>></li> | ||
|
@@ -955,9 +985,11 @@ <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> | ||
<h2><a class="toc-backref" href="#toc-entry-19">Maintainers</a></h2> | ||
<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" /></a> | ||
<a class="reference external image-reference" href="https://odoo-community.org"> | ||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /> | ||
</a> | ||
<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> | ||
|