mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 10:12:01 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
|
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
width="60"
|
||||
height="60"
|
||||
viewBox="0 0 60 60"
|
||||
sodipodi:docname="icon.svg"
|
||||
inkscape:export-filename="icon.png"
|
||||
inkscape:export-xdpi="192"
|
||||
inkscape:export-ydpi="192">
|
||||
<metadata
|
||||
id="metadata8">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs6" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1855"
|
||||
inkscape:window-height="1176"
|
||||
id="namedview4"
|
||||
showgrid="false"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="50.171984"
|
||||
inkscape:cy="32.60344"
|
||||
inkscape:window-x="65"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true">
|
||||
<sodipodi:guide
|
||||
position="4.140625,50.300781"
|
||||
orientation="-0.70710678,0.70710678"
|
||||
id="guide3348" />
|
||||
<sodipodi:guide
|
||||
position="56.476562,43.945312"
|
||||
orientation="-0.70710678,0.70710678"
|
||||
id="guide3350" />
|
||||
<sodipodi:guide
|
||||
position="0,41.75"
|
||||
orientation="1,0"
|
||||
id="guide3360" />
|
||||
<sodipodi:guide
|
||||
position="60,60.074219"
|
||||
orientation="1,0"
|
||||
id="guide3362" />
|
||||
<sodipodi:guide
|
||||
position="0.17578125,60"
|
||||
orientation="0,1"
|
||||
id="guide3364" />
|
||||
<sodipodi:guide
|
||||
position="58.71196,-0.0055242717"
|
||||
orientation="0,1"
|
||||
id="guide3366" />
|
||||
<sodipodi:guide
|
||||
position="15.558594,50.5"
|
||||
orientation="-0.70710678,0.70710678"
|
||||
id="guide3345" />
|
||||
<sodipodi:guide
|
||||
position="56.101563,32.363281"
|
||||
orientation="-0.70710678,0.70710678"
|
||||
id="guide3347" />
|
||||
<sodipodi:guide
|
||||
position="55.972656,21.027344"
|
||||
orientation="-0.70710678,0.70710678"
|
||||
id="guide3349" />
|
||||
<sodipodi:guide
|
||||
position="55.863281,9.6914063"
|
||||
orientation="-0.70710678,0.70710678"
|
||||
id="guide3351" />
|
||||
</sodipodi:namedview>
|
||||
<rect
|
||||
style="opacity:1;fill:#e74c3c;fill-opacity:1"
|
||||
id="rect4147"
|
||||
width="60"
|
||||
height="60"
|
||||
x="0"
|
||||
y="0" />
|
||||
<path
|
||||
style="opacity:1;fill:#000000;fill-opacity:0.39215686"
|
||||
d="M 4.1318557,9.7144566 0.0078125,13.824141 0,60 l 46.171301,0.0088 9.791208,-9.800508 -4.088791,-7.131947 4.086426,-4.114418 -4.058547,-7.106958 4.016339,-4.017997 -4.036551,-7.171615 4.058726,-4.069362 -40.612885,-6.8632798 -4.011838,4.0145788 z"
|
||||
id="rect4171"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccccccc" />
|
||||
<g
|
||||
id="g4169"
|
||||
transform="matrix(0.3061173,0,0,0.3061173,-1.0360053,-1.0457906)"
|
||||
style="fill:#ffffff;stroke:none" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:52.32963562px;line-height:125%;font-family:FontAwesome;-inkscape-font-specification:FontAwesome;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="3.8388314"
|
||||
y="50.558071"
|
||||
id="text3352"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3354"
|
||||
x="3.8388314"
|
||||
y="50.558071"></tspan></text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4 KiB |
|
|
@ -0,0 +1,481 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>Job Queue Batch</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* 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 }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="job-queue-batch">
|
||||
<h1 class="title">Job Queue Batch</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:7eceb569ec18547f2b64717734aecc66c0db338d51e13d6f1324785c6c2f8407
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/16.0/queue_job_batch"><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-16-0/queue-16-0-queue_job_batch"><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=16.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 a grouper for queue jobs.</p>
|
||||
<p>It allows to show your jobs in a batched form in order to know better the
|
||||
results.</p>
|
||||
<p>Example:</p>
|
||||
<pre class="code python literal-block">
|
||||
<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">
|
||||
</span><span class="kn">from</span> <span class="nn">odoo.addons.queue_job.job</span> <span class="kn">import</span> <span class="n">job</span><span class="w">
|
||||
|
||||
</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">
|
||||
</span> <span class="n">_name</span> <span class="o">=</span> <span class="s1">'my.model'</span><span class="w">
|
||||
|
||||
</span> <span class="nd">@api</span><span class="o">.</span><span class="n">multi</span><span class="w">
|
||||
</span> <span class="nd">@job</span><span class="w">
|
||||
</span> <span class="k">def</span> <span class="nf">my_method</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">k</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span><span class="w">
|
||||
</span> <span class="n">_logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">'executed with a: </span><span class="si">%s</span><span class="s1"> and k: </span><span class="si">%s</span><span class="s1">'</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span><span class="w">
|
||||
|
||||
|
||||
</span><span class="k">class</span> <span class="nc">MyOtherModel</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">
|
||||
</span> <span class="n">_name</span> <span class="o">=</span> <span class="s1">'my.other.model'</span><span class="w">
|
||||
|
||||
</span> <span class="nd">@api</span><span class="o">.</span><span class="n">multi</span><span class="w">
|
||||
</span> <span class="k">def</span> <span class="nf">button_do_stuff</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span><span class="w">
|
||||
</span> <span class="n">batch</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'queue.job.batch'</span><span class="p">]</span><span class="o">.</span><span class="n">get_new_batch</span><span class="p">(</span><span class="s1">'Group'</span><span class="p">)</span><span class="w">
|
||||
</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">100</span><span class="p">):</span><span class="w">
|
||||
</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_context</span><span class="p">(</span><span class="w">
|
||||
</span> <span class="n">job_batch</span><span class="o">=</span><span class="n">batch</span><span class="w">
|
||||
</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="n">i</span><span class="p">)</span><span class="w">
|
||||
</span> <span class="n">batch</span><span class="o">.</span><span class="n">enqueue</span><span class="p">()</span>
|
||||
</pre>
|
||||
<p>In the snippet of code above, when we call <tt class="docutils literal">button_do_stuff</tt>, 100 jobs
|
||||
capturing the method and arguments will be postponed. It will be executed as
|
||||
soon as the Jobrunner has a free bucket, which can be instantaneous if no other
|
||||
job is running.</p>
|
||||
<p>Once all the jobs have finished, the grouper will be marked as finished.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#other-credits" id="toc-entry-6">Other credits</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
|
||||
<p>You can manage your batch jobs from the Systray. A new button will be shown
|
||||
with your currently executing job batches and the recently finished job groups.</p>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">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_batch%0Aversion:%2016.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-3">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Creu Blanca</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Enric Tobella <<a class="reference external" href="mailto:etobella@creublanca.es">etobella@creublanca.es</a>></li>
|
||||
<li><dl class="first docutils">
|
||||
<dt><a class="reference external" href="https://trobz.com">Trobz</a>:</dt>
|
||||
<dd><ul class="first last">
|
||||
<li>Hoang Diep <<a class="reference external" href="mailto:hoang@trobz.com">hoang@trobz.com</a>></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><dl class="first docutils">
|
||||
<dt><a class="reference external" href="https://forgeflow.com">ForgeFlow</a>:</dt>
|
||||
<dd><ul class="first last">
|
||||
<li>Lois Rilo <<a class="reference external" href="mailto:lois.rilo@forgeflow.com">lois.rilo@forgeflow.com</a>></li>
|
||||
<li>Jasmin Solanki <<a class="reference external" href="mailto:jasmin.solanki@forgeflow.com">jasmin.solanki@forgeflow.com</a>></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="other-credits">
|
||||
<h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
|
||||
<p>The migration of this module from 12.0 to 14.0 was financially supported by Camptocamp</p>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#toc-entry-7">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
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/16.0/queue_job_batch">OCA/queue</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import {one} from "@mail/model/model_field";
|
||||
import {registerModel} from "@mail/model/model_core";
|
||||
import session from "web.session";
|
||||
const {Component} = owl;
|
||||
|
||||
registerModel({
|
||||
name: "QueueJobBatch",
|
||||
modelMethods: {
|
||||
convertData(data) {
|
||||
return {
|
||||
irModel: {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
job_count: data.job_count,
|
||||
completeness: data.completeness,
|
||||
failed_percentage: data.failed_percentage,
|
||||
finished_job_count: data.finished_job_count,
|
||||
failed_job_count: data.failed_job_count,
|
||||
state: data.state,
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
recordMethods: {
|
||||
_hideJobBatch: function () {
|
||||
var res_id = this.irModel.id;
|
||||
this.queueJobBatchMenuView.close();
|
||||
this.delete();
|
||||
Component.env.services.rpc({
|
||||
model: "queue.job.batch",
|
||||
method: "set_read",
|
||||
args: [res_id],
|
||||
kwargs: {
|
||||
context: session.user_context,
|
||||
},
|
||||
});
|
||||
},
|
||||
_onQueueJobBatchClick: function () {
|
||||
var res_id = this.irModel.id;
|
||||
this._hideJobBatch();
|
||||
this.env.services.action.doAction({
|
||||
type: "ir.actions.act_window",
|
||||
name: "Job batches",
|
||||
res_model: "queue.job.batch",
|
||||
views: [[false, "form"]],
|
||||
res_id: res_id,
|
||||
});
|
||||
},
|
||||
},
|
||||
fields: {
|
||||
queueJobBatchMenuView: one("QueueJobBatchMenuView", {
|
||||
identifying: true,
|
||||
inverse: "queueJobBatches",
|
||||
}),
|
||||
irModel: one("ir.model.queuejobbatch", {
|
||||
identifying: true,
|
||||
inverse: "queueJobBatch",
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
// ensure components are registered beforehand.
|
||||
import "./batch_menu_view.esm";
|
||||
import {getMessagingComponent} from "@mail/utils/messaging_component";
|
||||
|
||||
const {Component} = owl;
|
||||
|
||||
export class QueueJobBatchMenuContainer extends Component {
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
setup() {
|
||||
super.setup();
|
||||
this.env.services.messaging.modelManager.messagingCreatedPromise.then(() => {
|
||||
this.queueJobBatchMenuView =
|
||||
this.env.services.messaging.modelManager.messaging.models.QueueJobBatchMenuView.insert();
|
||||
this.render();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(QueueJobBatchMenuContainer, {
|
||||
components: {QueueJobBatchMenuView: getMessagingComponent("QueueJobBatchMenuView")},
|
||||
template: "queue_job_batch.QueueJobBatchMenuContainer",
|
||||
});
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import {attr, many} from "@mail/model/model_field";
|
||||
import {registerModel} from "@mail/model/model_core";
|
||||
|
||||
import session from "web.session";
|
||||
|
||||
registerModel({
|
||||
name: "QueueJobBatchMenuView",
|
||||
lifecycleHooks: {
|
||||
_created() {
|
||||
this.fetchData();
|
||||
document.addEventListener("click", this._onClickCaptureGlobal, true);
|
||||
},
|
||||
_willDelete() {
|
||||
document.removeEventListener("click", this._onClickCaptureGlobal, true);
|
||||
},
|
||||
},
|
||||
recordMethods: {
|
||||
close() {
|
||||
this.update({isOpen: false});
|
||||
},
|
||||
async fetchData() {
|
||||
const data = await this.messaging.rpc({
|
||||
model: "queue.job.batch",
|
||||
method: "search_read",
|
||||
args: [
|
||||
[
|
||||
["user_id", "=", session.uid],
|
||||
"|",
|
||||
["state", "in", ["draft", "progress"]],
|
||||
["is_read", "=", false],
|
||||
],
|
||||
[
|
||||
"name",
|
||||
"job_count",
|
||||
"completeness",
|
||||
"failed_percentage",
|
||||
"finished_job_count",
|
||||
"failed_job_count",
|
||||
"state",
|
||||
],
|
||||
],
|
||||
kwargs: {context: session.user_context},
|
||||
});
|
||||
this.update({
|
||||
queueJobBatches: data.map((vals) =>
|
||||
this.messaging.models.QueueJobBatch.convertData(vals)
|
||||
),
|
||||
});
|
||||
},
|
||||
/**
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
onClickDropdownToggle(ev) {
|
||||
ev.preventDefault();
|
||||
if (this.isOpen) {
|
||||
this.update({isOpen: false});
|
||||
} else {
|
||||
this.update({isOpen: true});
|
||||
this.fetchData();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Closes the menu when clicking outside, if appropriate.
|
||||
*
|
||||
* @private
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
_onClickCaptureGlobal(ev) {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
if (!this.component || !this.component.root.el) {
|
||||
return;
|
||||
}
|
||||
if (this.component.root.el.contains(ev.target)) {
|
||||
return;
|
||||
}
|
||||
this.close();
|
||||
},
|
||||
_viewAllQueueJobBatches: function () {
|
||||
this.close();
|
||||
this.env.services.action.doAction(
|
||||
"queue_job_batch.action_view_your_queue_job_batch"
|
||||
);
|
||||
},
|
||||
},
|
||||
fields: {
|
||||
queueJobBatches: many("QueueJobBatch", {
|
||||
sort: [["greater-first", "irModel.id"]],
|
||||
inverse: "queueJobBatchMenuView",
|
||||
}),
|
||||
component: attr(),
|
||||
counter: attr({
|
||||
compute() {
|
||||
return this.queueJobBatches.length;
|
||||
},
|
||||
}),
|
||||
isOpen: attr({
|
||||
default: false,
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import {registerMessagingComponent} from "@mail/utils/messaging_component";
|
||||
import {useComponentToModel} from "@mail/component_hooks/use_component_to_model";
|
||||
|
||||
const {Component} = owl;
|
||||
|
||||
export class QueueJobBatchMenuView extends Component {
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
setup() {
|
||||
super.setup();
|
||||
useComponentToModel({fieldName: "component"});
|
||||
}
|
||||
/**
|
||||
* @returns {QueueJobBatchMenuView}
|
||||
*/
|
||||
get queueJobBatchMenuView() {
|
||||
return this.props.record;
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(QueueJobBatchMenuView, {
|
||||
props: {record: Object},
|
||||
template: "queue_job_batch.QueueJobBatchMenuView",
|
||||
});
|
||||
|
||||
registerMessagingComponent(QueueJobBatchMenuView);
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import {attr, one} from "@mail/model/model_field";
|
||||
import {registerModel} from "@mail/model/model_core";
|
||||
|
||||
registerModel({
|
||||
name: "ir.model.queuejobbatch",
|
||||
fields: {
|
||||
/**
|
||||
* Determines the name of the views that are available for this model.
|
||||
*/
|
||||
availableWebViews: attr({
|
||||
compute() {
|
||||
return ["kanban", "list", "form", "activity"];
|
||||
},
|
||||
}),
|
||||
queueJobBatch: one("QueueJobBatch", {
|
||||
inverse: "irModel",
|
||||
}),
|
||||
id: attr({
|
||||
identifying: true,
|
||||
}),
|
||||
name: attr(),
|
||||
job_count: attr(),
|
||||
completeness: attr(),
|
||||
failed_percentage: attr(),
|
||||
finished_job_count: attr(),
|
||||
failed_job_count: attr(),
|
||||
state: attr(),
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import {QueueJobBatchMenuContainer} from "./batch_menu_container_view.esm";
|
||||
import {registry} from "@web/core/registry";
|
||||
import session from "web.session";
|
||||
|
||||
const systrayRegistry = registry.category("systray");
|
||||
|
||||
export const systrayService = {
|
||||
start() {
|
||||
session
|
||||
.user_has_group("queue_job_batch.group_queue_job_batch_user")
|
||||
.then(function (has_group) {
|
||||
if (has_group) {
|
||||
systrayRegistry.add(
|
||||
"queue_job_batch.QueueJobBatchMenu",
|
||||
{Component: QueueJobBatchMenuContainer},
|
||||
{sequence: 99}
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
const serviceRegistry = registry.category("services");
|
||||
serviceRegistry.add("queuebatch_systray_service", systrayService);
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
.o_job_batch_navbar_item {
|
||||
.o_notification_counter {
|
||||
margin-top: -0.8rem;
|
||||
margin-right: 0;
|
||||
margin-left: -0.6rem;
|
||||
background: $o-enterprise-primary-color;
|
||||
color: white;
|
||||
vertical-align: super;
|
||||
font-size: 0.7em;
|
||||
}
|
||||
.o_job_batch_navbar_dropdown {
|
||||
width: 350px;
|
||||
padding: 0;
|
||||
}
|
||||
.o_view_all_batch_jobs {
|
||||
padding: 5px;
|
||||
}
|
||||
.o_job_queue_failed {
|
||||
color: red;
|
||||
}
|
||||
.o_job_queue_finished {
|
||||
color: green;
|
||||
}
|
||||
.o_job_queue_progress {
|
||||
color: gray;
|
||||
}
|
||||
.o_progressbar_complete {
|
||||
&.o_queue_job_finished_progressbar {
|
||||
background-color: green;
|
||||
float: left;
|
||||
}
|
||||
|
||||
&.o_queue_job_failed_progressbar {
|
||||
background-color: red;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates>
|
||||
|
||||
<t t-name="queue_job_batch.QueueJobBatchMenuView" owl="1">
|
||||
<div class="o_ActivityMenuView dropdown o_job_batch_navbar_item" t-ref="root">
|
||||
<a
|
||||
class="o_ActivityMenuView_dropdownToggle dropdown-toggle o-no-caret o-dropdown--narrow"
|
||||
title="Job batches"
|
||||
t-att-aria-expanded="queueJobBatchMenuView.isOpen ? 'true' : 'false'"
|
||||
href="#"
|
||||
role="button"
|
||||
t-on-click="queueJobBatchMenuView.onClickDropdownToggle"
|
||||
>
|
||||
<i class="fa fa-list" role="img" aria-label="Job batches" />
|
||||
<span
|
||||
t-if="queueJobBatchMenuView.counter > 0"
|
||||
class="o_ActivityMenuView_counter badge"
|
||||
t-esc="queueJobBatchMenuView.counter"
|
||||
/>
|
||||
</a>
|
||||
<div
|
||||
t-if="queueJobBatchMenuView.isOpen"
|
||||
class="o_ActivityMenuView_dropdownMenu o-dropdown-menu dropdown-menu-end show bg-view"
|
||||
role="menu"
|
||||
>
|
||||
<div
|
||||
class="border-bottom d-flex flex-shrink-0"
|
||||
bis_skin_checked="1"
|
||||
t-if="queueJobBatchMenuView.counter > 0"
|
||||
>
|
||||
<button
|
||||
class="o-desktop btn btn-link o-active fw-bolder"
|
||||
type="button"
|
||||
>Job
|
||||
Batches</button>
|
||||
<div class="flex-grow-1" bis_skin_checked="1" />
|
||||
<button
|
||||
class="btn btn-link"
|
||||
type="button"
|
||||
t-on-click="queueJobBatchMenuView._viewAllQueueJobBatches"
|
||||
>View All</button>
|
||||
</div>
|
||||
<t t-if="queueJobBatchMenuView.queueJobBatches.length === 0">
|
||||
<div class="o_ActivityMenuView_activityGroups">
|
||||
<div
|
||||
class="o_ActivityMenuView_noActivity dropdown-item-text text-center d-flex justify-content-center"
|
||||
>
|
||||
<span>No jobs to view.</span>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<div
|
||||
t-if="queueJobBatchMenuView.queueJobBatches.length > 0"
|
||||
class="row"
|
||||
style="width:100%"
|
||||
>
|
||||
<t
|
||||
t-foreach="queueJobBatchMenuView.queueJobBatches"
|
||||
t-as="queueJobBatch"
|
||||
t-key="queueJobBatch.localId"
|
||||
name="activityGroupLoop"
|
||||
>
|
||||
<div
|
||||
class="col-2 m-2"
|
||||
t-on-click="queueJobBatch._onQueueJobBatchClick"
|
||||
>
|
||||
<span
|
||||
class="fa fa-list fa-3x o_job_queue_failed"
|
||||
t-if="queueJobBatch.irModel.failed_job_count > 0"
|
||||
/>
|
||||
<span
|
||||
class="fa fa-list fa-3x o_job_queue_finished"
|
||||
t-if="queueJobBatch.irModel.failed_job_count == 0 and queueJobBatch.irModel.finished_job_count == queueJobBatch.irModel.job_count"
|
||||
/>
|
||||
<span
|
||||
class="fa fa-list fa-3x o_job_queue_progress"
|
||||
t-if="queueJobBatch.irModel.failed_job_count == 0 and queueJobBatch.irModel.finished_job_count != queueJobBatch.irModel.job_count"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col-8"
|
||||
t-on-click="queueJobBatch._onQueueJobBatchClick"
|
||||
>
|
||||
<strong
|
||||
class="o_NotificationListItem_name o_NotificationGroup_name text-truncate"
|
||||
>
|
||||
<t t-esc="queueJobBatch.irModel.name" />
|
||||
</strong>
|
||||
<div class="progress">
|
||||
<div
|
||||
class="progress-bar o_queue_job_finished_progressbar"
|
||||
role="progressbar"
|
||||
t-att-style="'width: '+ (100 * queueJobBatch.irModel.completeness) + '%'"
|
||||
t-att-aria-valuenow="100 * queueJobBatch.irModel.completeness"
|
||||
/>
|
||||
<div
|
||||
class="progress-bar o_queue_job_failed_progressbar"
|
||||
role="progressbar"
|
||||
t-att-style="'width: '+ (100 * queueJobBatch.irModel.failed_percentage) + '%'"
|
||||
t-att-aria-valuenow="100 * queueJobBatch.irModel.failed_percentage"
|
||||
/>
|
||||
</div>
|
||||
<span
|
||||
t-out="queueJobBatch.irModel.finished_job_count + '/' + queueJobBatch.irModel.failed_job_count + '/' + queueJobBatch.irModel.job_count"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col-1 mt-3"
|
||||
t-on-click="queueJobBatch._hideJobBatch"
|
||||
>
|
||||
<span
|
||||
title="Mark as Read"
|
||||
class="fa fa-check"
|
||||
t-if="queueJobBatch.irModel.state === 'finished'"
|
||||
t-att-data-job-batch-id="queueJobBatch.irModel.id"
|
||||
/>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates xml:space="preserve">
|
||||
<t t-name="queue_job_batch.QueueJobBatchMenuContainer" owl="1">
|
||||
<t t-if="queueJobBatchMenuView">
|
||||
<QueueJobBatchMenuView record="queueJobBatchMenuView" />
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
Loading…
Add table
Add a link
Reference in a new issue