|
8 | 8 |
|
9 | 9 | /*
|
10 | 10 | :Author: David Goodger ([email protected])
|
11 |
| -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ |
| 11 | +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ |
12 | 12 | :Copyright: This stylesheet has been placed in the public domain.
|
13 | 13 |
|
14 | 14 | Default cascading style sheet for the HTML output of Docutils.
|
| 15 | +Despite the name, some widely supported CSS2 features are used. |
15 | 16 |
|
16 | 17 | See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
17 | 18 | customize this style sheet.
|
|
274 | 275 | margin-left: 2em ;
|
275 | 276 | margin-right: 2em }
|
276 | 277 |
|
277 |
| -pre.code .ln { color: grey; } /* line numbers */ |
| 278 | +pre.code .ln { color: gray; } /* line numbers */ |
278 | 279 | pre.code, code { background-color: #eeeeee }
|
279 | 280 | pre.code .comment, code .comment { color: #5C6576 }
|
280 | 281 | pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
300 | 301 | span.pre {
|
301 | 302 | white-space: pre }
|
302 | 303 |
|
303 |
| -span.problematic { |
| 304 | +span.problematic, pre.problematic { |
304 | 305 | color: red }
|
305 | 306 |
|
306 | 307 | span.section-subtitle {
|
@@ -715,6 +716,28 @@ <h3><a class="toc-backref" href="#toc-entry-7">Configure default options for job
|
715 | 716 | <li>retries 10 to 15 postponed 30 seconds later</li>
|
716 | 717 | <li>all subsequent retries postponed 5 minutes later</li>
|
717 | 718 | </ul>
|
| 719 | +<p><strong>Job function: reach max retryable times</strong></p> |
| 720 | +<p>When a job has reached the maximum number of retries and still fails, |
| 721 | +the job’s status will be set to <cite>Failed</cite>. |
| 722 | +You can define a specific method to handle this event. |
| 723 | +The method should be named <cite>{method_name}_on_max_retries_reached</cite>.</p> |
| 724 | +<p>Here’s an example:</p> |
| 725 | +<pre class="code python literal-block"> |
| 726 | +<span class="kn">from</span> <span class="nn">odoo</span> <span class="kn">import</span> <span class="n">models</span><span class="p">,</span> <span class="n">fields</span><span class="p">,</span> <span class="n">api</span><span class="w"> |
| 727 | + |
| 728 | +</span><span class="k">class</span> <span class="nc">MyModel</span><span class="p">(</span><span class="n">models</span><span class="o">.</span><span class="n">Model</span><span class="p">):</span><span class="w"> |
| 729 | +</span> <span class="n">_name</span> <span class="o">=</span> <span class="s1">'my.model'</span><span class="w"> |
| 730 | + |
| 731 | +</span> <span class="k">def</span> <span class="nf">button_done</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span><span class="w"> |
| 732 | +</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'my.model'</span><span class="p">]</span><span class="o">.</span><span class="n">with_delay</span><span class="p">()</span><span class="o">.</span><span class="n">my_method</span><span class="p">(</span><span class="s1">'a'</span><span class="p">,</span> <span class="n">k</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span><span class="w"> |
| 733 | + |
| 734 | +</span> <span class="k">def</span> <span class="nf">my_method_on_max_retries_reached</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span><span class="w"> |
| 735 | +</span> <span class="c1"># This method is called when the job reaches the maximum retries and fails</span><span class="w"> |
| 736 | +</span> <span class="c1"># Add your custom logic here</span> |
| 737 | +</pre> |
| 738 | +<p>In this example, <cite>my_method_on_max_retries_reached`</cite> is the method |
| 739 | +that will be called when the job my_method fails after reaching the maximum retries. |
| 740 | +You can add your custom logic inside this method to handle the event.</p> |
718 | 741 | <p><strong>Job Context</strong></p>
|
719 | 742 | <p>The context of the recordset of the job, or any recordset passed in arguments of
|
720 | 743 | a job, is transferred to the job according to an allow-list.</p>
|
@@ -958,7 +981,9 @@ <h2><a class="toc-backref" href="#toc-entry-17">Contributors</a></h2>
|
958 | 981 | <div class="section" id="maintainers">
|
959 | 982 | <h2><a class="toc-backref" href="#toc-entry-18">Maintainers</a></h2>
|
960 | 983 | <p>This module is maintained by the OCA.</p>
|
961 |
| -<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> |
| 984 | +<a class="reference external image-reference" href="https://odoo-community.org"> |
| 985 | +<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /> |
| 986 | +</a> |
962 | 987 | <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
963 | 988 | mission is to support the collaborative development of Odoo features and
|
964 | 989 | promote its widespread use.</p>
|
|
0 commit comments