Skip to content

Commit 63933a5

Browse files
committed
[19.0][MIG] queue_job_batch: migrate
Scope: queue_job_batch, test_queue_job_batch
1 parent d2a8e90 commit 63933a5

File tree

11 files changed

+85
-74
lines changed

11 files changed

+85
-74
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ exclude: |
22
(?x)
33
# NOT INSTALLABLE ADDONS
44
^base_import_async/|
5-
^queue_job_batch/|
65
^queue_job_cron/|
76
^queue_job_cron_jobrunner/|
87
^queue_job_subscribe/|
9-
^test_queue_job_batch/|
108
# END NOT INSTALLABLE ADDONS
119
# Files and folders generated by bots, to avoid loops
1210
^setup/|/static/description/index\.html$|

queue_job_batch/README.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
===============
26
Job Queue Batch
37
===============
@@ -13,17 +17,17 @@ Job Queue Batch
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github
20-
:target: https://github.com/OCA/queue/tree/18.0/queue_job_batch
24+
:target: https://github.com/OCA/queue/tree/19.0/queue_job_batch
2125
:alt: OCA/queue
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-queue_job_batch
27+
:target: https://translation.odoo-community.org/projects/queue-19-0/queue-19-0-queue_job_batch
2428
:alt: Translate me on Weblate
2529
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=19.0
2731
:alt: Try me on Runboat
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -82,7 +86,7 @@ Bug Tracker
8286
Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_.
8387
In case of trouble, please check there if your issue has already been reported.
8488
If you spotted it first, help us to smash it by providing a detailed and welcomed
85-
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20queue_job_batch%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
89+
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20queue_job_batch%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
8690

8791
Do not contact contributors directly about support or help with technical issues.
8892

@@ -132,6 +136,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
132136
mission is to support the collaborative development of Odoo features and
133137
promote its widespread use.
134138

135-
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/18.0/queue_job_batch>`_ project on GitHub.
139+
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/19.0/queue_job_batch>`_ project on GitHub.
136140

137141
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

queue_job_batch/__manifest__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{
66
"name": "Job Queue Batch",
7-
"version": "18.0.1.0.0",
7+
"version": "19.0.1.0.0",
88
"author": "Creu Blanca,Odoo Community Association (OCA)",
99
"website": "https://github.com/OCA/queue",
1010
"license": "AGPL-3",
@@ -29,7 +29,6 @@
2929
"queue_job_batch/static/src/**/*.xml",
3030
"queue_job_batch/static/src/**/*.scss",
3131
],
32-
'installable': False,
33-
},
34-
'installable': False,
32+
},
33+
"installable": True,
3534
}
File renamed without changes.

queue_job_batch/security/security.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<data>
44
<record id="group_queue_job_batch_user" model="res.groups">
55
<field name="name">Job Queue Batch User</field>
6-
<field name="category_id" ref="queue_job.module_category_queue_job" />
6+
<field name="privilege_id" ref="queue_job.privilege_queue_job" />
77
</record>
88
<record id="queue_job.group_queue_job_manager" model="res.groups">
99
<field

queue_job_batch/static/description/index.html

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Job Queue Batch</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,36 +360,41 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="job-queue-batch">
364-
<h1 class="title">Job Queue Batch</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="job-queue-batch">
370+
<h1>Job Queue Batch</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:b6e605728ea05be0bf98dbe6e94c197bab21882e965286ef214f719e252b444e
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<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/18.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-18-0/queue-18-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&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/19.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-19-0/queue-19-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&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>This addon adds an a grouper for queue jobs.</p>
374379
<p>It allows to show your jobs in a batched form in order to know better
375380
the results.</p>
376381
<p>Example:</p>
377382
<pre class="code python literal-block">
378-
<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">
383+
<span class="kn">from</span><span class="w"> </span><span class="nn">odoo</span><span class="w"> </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">
379384

380385

381-
</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">
386+
</span><span class="k">class</span><span class="w"> </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">
382387
</span> <span class="n">_name</span> <span class="o">=</span> <span class="s1">'my.model'</span><span class="w">
383388

384-
</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">
389+
</span> <span class="k">def</span><span class="w"> </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">
385390
</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">
386391

387392

388-
</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">
393+
</span><span class="k">class</span><span class="w"> </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">
389394
</span> <span class="n">_name</span> <span class="o">=</span> <span class="s1">'my.other.model'</span><span class="w">
390395

391396
</span> <span class="nd">&#64;api</span><span class="o">.</span><span class="n">multi</span><span class="w">
392-
</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">
397+
</span> <span class="k">def</span><span class="w"> </span><span class="nf">button_do_stuff</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span><span class="w">
393398
</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">
394399
</span> <span class="n">model</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">'my.model'</span><span class="p">]</span><span class="o">.</span><span class="n">with_context</span><span class="p">(</span><span class="n">job_batch</span><span class="o">=</span><span class="n">batch</span><span class="p">)</span><span class="w">
395400
</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">
@@ -415,29 +420,29 @@ <h1 class="title">Job Queue Batch</h1>
415420
</ul>
416421
</div>
417422
<div class="section" id="usage">
418-
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
423+
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
419424
<p>You can manage your batch jobs from the Systray. A new button will be
420425
shown with your currently executing job batches and the recently
421426
finished job groups.</p>
422427
</div>
423428
<div class="section" id="bug-tracker">
424-
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
429+
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
425430
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/queue/issues">GitHub Issues</a>.
426431
In case of trouble, please check there if your issue has already been reported.
427432
If you spotted it first, help us to smash it by providing a detailed and welcomed
428-
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20queue_job_batch%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
433+
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20queue_job_batch%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
429434
<p>Do not contact contributors directly about support or help with technical issues.</p>
430435
</div>
431436
<div class="section" id="credits">
432-
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
437+
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
433438
<div class="section" id="authors">
434-
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
439+
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
435440
<ul class="simple">
436441
<li>Creu Blanca</li>
437442
</ul>
438443
</div>
439444
<div class="section" id="contributors">
440-
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
445+
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
441446
<ul class="simple">
442447
<li>Enric Tobella &lt;<a class="reference external" href="mailto:etobella&#64;creublanca.es">etobella&#64;creublanca.es</a>&gt;</li>
443448
<li><a class="reference external" href="https://trobz.com">Trobz</a>:<ul>
@@ -457,23 +462,24 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
457462
</ul>
458463
</div>
459464
<div class="section" id="other-credits">
460-
<h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
465+
<h3><a class="toc-backref" href="#toc-entry-6">Other credits</a></h3>
461466
<p>The migration of this module from 12.0 to 14.0 was financially supported
462467
by Camptocamp</p>
463468
</div>
464469
<div class="section" id="maintainers">
465-
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
470+
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
466471
<p>This module is maintained by the OCA.</p>
467472
<a class="reference external image-reference" href="https://odoo-community.org">
468473
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
469474
</a>
470475
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
471476
mission is to support the collaborative development of Odoo features and
472477
promote its widespread use.</p>
473-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/18.0/queue_job_batch">OCA/queue</a> project on GitHub.</p>
478+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/19.0/queue_job_batch">OCA/queue</a> project on GitHub.</p>
474479
<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>
475480
</div>
476481
</div>
477482
</div>
483+
</div>
478484
</body>
479485
</html>

queue_job_batch/static/src/components/QueueJobBatchMenu.esm.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
44
*/
55

6+
import {useDiscussSystray} from "@mail/utils/common/hooks";
67
import {Component, useState} from "@odoo/owl";
7-
import {ColumnProgress} from "@web/views/view_components/column_progress";
88
import {Dropdown} from "@web/core/dropdown/dropdown";
9-
import {registry} from "@web/core/registry";
10-
import {useDiscussSystray} from "@mail/utils/common/hooks";
119
import {useDropdownState} from "@web/core/dropdown/dropdown_hooks";
12-
import {useService} from "@web/core/utils/hooks";
13-
import {user} from "@web/core/user";
1410
import {_t} from "@web/core/l10n/translation";
11+
import {registry} from "@web/core/registry";
12+
import {user} from "@web/core/user";
13+
import {useService} from "@web/core/utils/hooks";
14+
import {ColumnProgress} from "@web/views/view_components/column_progress";
1515

1616
export class QueueJobBatchMenu extends Component {
1717
static template = "queue_job_batch.QueueJobBatchMenu";

queue_job_batch/views/queue_job_batch_views.xml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,7 @@
6464
<field name="name" />
6565
<field name="state" />
6666
<field name="user_id" />
67-
<field
68-
name="company_id"
69-
groups="base.group_multi_company"
70-
widget="selection"
71-
/>
67+
<field name="company_id" groups="base.group_multi_company" />
7268
<filter
7369
name="my_batches"
7470
string="My batches"
@@ -96,18 +92,17 @@
9692
string="Finished"
9793
domain="[('state', '=', 'finished')]"
9894
/>
99-
<group expand="0" string="Group By">
100-
<filter
101-
name="group_by_state"
102-
string="State"
103-
context="{'group_by': 'state'}"
104-
/>
105-
<filter
106-
name="group_by_user"
107-
string="User"
108-
context="{'group_by': 'user_id'}"
109-
/>
110-
</group>
95+
<separator />
96+
<filter
97+
name="group_by_state"
98+
string="State"
99+
context="{'group_by': 'state'}"
100+
/>
101+
<filter
102+
name="group_by_user"
103+
string="User"
104+
context="{'group_by': 'user_id'}"
105+
/>
111106
</search>
112107
</field>
113108
</record>

0 commit comments

Comments
 (0)