Skip to content

Commit

Permalink
[UPD] README.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
OCA-git-bot committed Dec 13, 2018
1 parent c87073e commit a57295c
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 19 deletions.
31 changes: 31 additions & 0 deletions queue_job/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,37 @@ To use this module, you need to:

#. Go to ``Job Queue`` menu

Developers
~~~~~~~~~~

**Bypass jobs on running Odoo**

When you are developing (ie: connector modules) you might want
to bypass the queue job and run your code immediately.

To do so you can set `TEST_QUEUE_JOB_NO_DELAY=1` in your enviroment.

**Bypass jobs in tests**

When writing tests on job-related methods is always tricky to deal with
delayed recordsets. To make your testing life easier
you can set `test_queue_job_no_delay=True` in the context.

Tip: you can do this at test case level like this

.. code-block:: python
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(
cls.env.context,
test_queue_job_no_delay=True, # no jobs thanks
))
Then all your tests execute the job methods synchronously
without delaying any jobs.

Known issues / Roadmap
======================

Expand Down
64 changes: 45 additions & 19 deletions queue_job/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,18 +416,21 @@ <h1 class="title">Job Queue</h1>
<ul class="simple">
<li><a class="reference internal" href="#installation" id="id4">Installation</a></li>
<li><a class="reference internal" href="#configuration" id="id5">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="id6">Usage</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="id7">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#changelog" id="id8">Changelog</a><ul>
<li><a class="reference internal" href="#next" id="id9">Next</a></li>
<li><a class="reference internal" href="#id3" id="id10">12.0.1.0.0 (2018-10-02)</a></li>
<li><a class="reference internal" href="#usage" id="id6">Usage</a><ul>
<li><a class="reference internal" href="#developers" id="id7">Developers</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bug-tracker" id="id11">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id12">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id13">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id14">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id15">Maintainers</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="id8">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#changelog" id="id9">Changelog</a><ul>
<li><a class="reference internal" href="#next" id="id10">Next</a></li>
<li><a class="reference internal" href="#id3" id="id11">12.0.1.0.0 (2018-10-02)</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bug-tracker" id="id12">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id13">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id14">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id15">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id16">Maintainers</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -491,9 +494,32 @@ <h1><a class="toc-backref" href="#id6">Usage</a></h1>
<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="#id7">Developers</a></h2>
<p><strong>Bypass jobs on running Odoo</strong></p>
<p>When you are developing (ie: connector modules) you might want
to bypass the queue job and run your code immediately.</p>
<p>To do so you can set <cite>TEST_QUEUE_JOB_NO_DELAY=1</cite> in your enviroment.</p>
<p><strong>Bypass jobs in tests</strong></p>
<p>When writing tests on job-related methods is always tricky to deal with
delayed recordsets. To make your testing life easier
you can set <cite>test_queue_job_no_delay=True</cite> in the context.</p>
<p>Tip: you can do this at test case level like this</p>
<pre class="code python literal-block">
<span class="nd">&#64;classmethod</span>
<span class="k">def</span> <span class="nf">setUpClass</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">setUpClass</span><span class="p">()</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">env</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">env</span><span class="p">(</span><span class="n">context</span><span class="o">=</span><span class="nb">dict</span><span class="p">(</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">env</span><span class="o">.</span><span class="n">context</span><span class="p">,</span>
<span class="n">test_queue_job_no_delay</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="c1"># no jobs thanks</span>
<span class="p">))</span>
</pre>
<p>Then all your tests execute the job methods synchronously
without delaying any jobs.</p>
</div>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#id7">Known issues / Roadmap</a></h1>
<h1><a class="toc-backref" href="#id8">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 it.</li>
Expand All @@ -514,7 +540,7 @@ <h1><a class="toc-backref" href="#id7">Known issues / Roadmap</a></h1>
</pre>
</div>
<div class="section" id="changelog">
<h1><a class="toc-backref" href="#id8">Changelog</a></h1>
<h1><a class="toc-backref" href="#id9">Changelog</a></h1>
<!-- [ 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 @@ -525,34 +551,34 @@ <h1><a class="toc-backref" href="#id8">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="#id9">Next</a></h2>
<h2><a class="toc-backref" href="#id10">Next</a></h2>
</div>
<div class="section" id="id3">
<h2><a class="toc-backref" href="#id10">12.0.1.0.0 (2018-10-02)</a></h2>
<h2><a class="toc-backref" href="#id11">12.0.1.0.0 (2018-10-02)</a></h2>
<ul class="simple">
<li>[MIGRATION] from 11.0 branched at rev. b0945be</li>
</ul>
</div>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id11">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#id12">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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20queue_job%0Aversion:%2012.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="#id12">Credits</a></h1>
<h1><a class="toc-backref" href="#id13">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id13">Authors</a></h2>
<h2><a class="toc-backref" href="#id14">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="#id14">Contributors</a></h2>
<h2><a class="toc-backref" href="#id15">Contributors</a></h2>
<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 @@ -564,7 +590,7 @@ <h2><a class="toc-backref" href="#id14">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id15">Maintainers</a></h2>
<h2><a class="toc-backref" href="#id16">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>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
Expand Down

0 comments on commit a57295c

Please sign in to comment.