Skip to content

Commit 411eeb3

Browse files
author
Matthias Barkat
committed
[MIG] queue_job_batch: Migration to 17.0
1 parent 8a90419 commit 411eeb3

File tree

13 files changed

+34
-57
lines changed

13 files changed

+34
-57
lines changed

queue_job_batch/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Job Queue Batch
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |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
20+
:target: https://github.com/OCA/queue/tree/17.0/queue_job_batch
2121
:alt: OCA/queue
2222
.. |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
23+
:target: https://translation.odoo-community.org/projects/queue-17-0/queue-17-0-queue_job_batch
2424
:alt: Translate me on Weblate
2525
.. |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
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=17.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -82,7 +82,7 @@ Bug Tracker
8282
Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_.
8383
In case of trouble, please check there if your issue has already been reported.
8484
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**>`_.
85+
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20queue_job_batch%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
8686

8787
Do not contact contributors directly about support or help with technical issues.
8888

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

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

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

queue_job_batch/__manifest__.py

Lines changed: 1 addition & 1 deletion
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": "17.0.1.0.0",
88
"author": "Creu Blanca,Odoo Community Association (OCA)",
99
"website": "https://github.com/OCA/queue",
1010
"license": "AGPL-3",
File renamed without changes.

queue_job_batch/models/queue_job_batch.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
from odoo import api, fields, models
66

7-
from odoo.addons.mail.tools.discuss import Store
8-
97

108
class QueueJobBatch(models.Model):
119
_name = "queue.job.batch"
@@ -83,7 +81,6 @@ def set_read(self):
8381
if rec.is_read or rec.state != "finished":
8482
continue
8583
rec.is_read = True
86-
rec.user_id._bus_send("queue.job.batch/updated", {"batch_read": True})
8784

8885
@api.model
8986
def get_new_batch(self, name, **kwargs):
@@ -96,7 +93,6 @@ def get_new_batch(self, name, **kwargs):
9693
}
9794
)
9895
record = self.sudo().create(vals).with_user(self.env.uid)
99-
record.user_id._bus_send("queue.job.batch/updated", {"batch_created": True})
10096
return record
10197

10298
@api.depends("job_ids.state")
@@ -108,21 +104,3 @@ def _compute_job_count(self):
108104
rec.finished_job_count = len(jobs_by_state.get("done", []))
109105
rec.completeness = rec.finished_job_count / max(1, rec.job_count)
110106
rec.failed_percentage = rec.failed_job_count / max(1, rec.job_count)
111-
112-
@api.model
113-
def _to_store_fnames(self):
114-
return (
115-
"name",
116-
"state",
117-
"job_count",
118-
"finished_job_count",
119-
"failed_job_count",
120-
"completeness",
121-
"failed_percentage",
122-
)
123-
124-
def _to_store(self, store: Store):
125-
fnames = self._to_store_fnames()
126-
for rec in self:
127-
data = rec.read(fnames)[0]
128-
store.add(rec, data)

queue_job_batch/static/description/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -369,27 +369,27 @@ <h1 class="title">Job Queue Batch</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:b6e605728ea05be0bf98dbe6e94c197bab21882e965286ef214f719e252b444e
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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>
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/17.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-17-0/queue-17-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=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This addon adds an a grouper for queue jobs.</p>
374374
<p>It allows to show your jobs in a batched form in order to know better
375375
the results.</p>
376376
<p>Example:</p>
377377
<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">
378+
<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">
379379

380380

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

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">
384+
</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">
385385
</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">
386386

387387

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

391391
</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">
392+
</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">
393393
</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">
394394
</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">
395395
</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">
@@ -425,7 +425,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
425425
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/queue/issues">GitHub Issues</a>.
426426
In case of trouble, please check there if your issue has already been reported.
427427
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>
428+
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20queue_job_batch%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
429429
<p>Do not contact contributors directly about support or help with technical issues.</p>
430430
</div>
431431
<div class="section" id="credits">
@@ -470,7 +470,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
470470
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
471471
mission is to support the collaborative development of Odoo features and
472472
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>
473+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/17.0/queue_job_batch">OCA/queue</a> project on GitHub.</p>
474474
<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>
475475
</div>
476476
</div>

queue_job_batch/static/src/MailCoreWeb.esm.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @odoo-module */
2+
13
import {MailCoreWeb} from "@mail/core/web/mail_core_web_service";
24
import {patch} from "@web/core/utils/patch";
35

queue_job_batch/static/src/QueueJobBatchModel.esm.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @odoo-module */
2+
13
import {Record} from "@mail/core/common/record";
24
import {_t} from "@web/core/l10n/translation";
35

queue_job_batch/static/src/Store.esm.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
/*
2-
Copyright 2025 Camptocamp SA (https://www.camptocamp.com).
3-
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
4-
*/
5-
import {Store, pyToJsModels} from "@mail/core/common/store_service";
1+
/* @odoo-module */
2+
3+
import {Store} from "@mail/core/common/store_service";
64
import {patch} from "@web/core/utils/patch";
75

8-
pyToJsModels["queue.job.batch"] = "QueueJobBatch";
6+
// PyToJsModels["queue.job.batch"] = "QueueJobBatch";
97

108
patch(Store.prototype, {
119
hasQueueJobBatchUserGroup: false,

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/*
2-
Copyright 2025 Camptocamp SA (https://www.camptocamp.com).
3-
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
4-
*/
1+
/* @odoo-module */
52

63
import {Component, useState} from "@odoo/owl";
74
import {ColumnProgress} from "@web/views/view_components/column_progress";

queue_job_batch/views/queue_job_batch_views.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<field name="name">queue.job.batch.tree</field>
55
<field name="model">queue.job.batch</field>
66
<field name="arch" type="xml">
7-
<list create="false" delete="false">
7+
<tree create="false" delete="false">
88
<field name="name" />
99
<field name="job_count" column_invisible="1" />
1010
<field
@@ -14,7 +14,7 @@
1414
options="{'current_value': 'finished_job_count', 'max_value': 'job_count'}"
1515
/>
1616
<field name="state" />
17-
</list>
17+
</tree>
1818
</field>
1919
</record>
2020

0 commit comments

Comments
 (0)