Skip to content

Commit e52dedb

Browse files
committed
fix(spp_hxl_area,spp_import_match): migrate from queue_job to job_worker
These two modules were missed in the original migration (PR #55). - Replace queue_job dependency with job_worker in manifests - Replace FailedJobError with UserError in spp_import_match - Remove queue_job_data.xml (queue.job.function model not in job_worker) - Update readme descriptions
1 parent 82005a6 commit e52dedb

File tree

11 files changed

+69
-107
lines changed

11 files changed

+69
-107
lines changed

spp_hxl_area/README.rst

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,32 @@ Key Capabilities
4343
processing → done)
4444
- Auto-sync indicators to ``spp.data.value`` for CEL expression access
4545
- Link imports to hazard incidents for disaster response tracking
46-
- Process imports asynchronously via queue_job
46+
- Process imports asynchronously via job_worker
4747

4848
Key Models
4949
~~~~~~~~~~
5050

51-
+--------------------------------+-------------------------------------+
52-
| Model | Description |
53-
+================================+=====================================+
54-
| ``spp.hxl.import.profile`` | Configuration defining area |
55-
| | matching and rules |
56-
+--------------------------------+-------------------------------------+
57-
| ``spp.hxl.aggregation.rule`` | Rule specifying what to aggregate |
58-
| | and how |
59-
+--------------------------------+-------------------------------------+
60-
| ``spp.hxl.import.batch`` | Track one execution of profile |
61-
| | against HXL file |
62-
+--------------------------------+-------------------------------------+
63-
| ``spp.hxl.import.mapping`` | Auto-detected column mapping |
64-
| | (adjustable pre-run) |
65-
+--------------------------------+-------------------------------------+
66-
| ``spp.hxl.area.indicator`` | Aggregated indicator value stored |
67-
| | per area |
68-
+--------------------------------+-------------------------------------+
69-
| ``spp.hxl.area.import.wizard`` | Wizard for uploading files and |
70-
| | previewing matches |
71-
+--------------------------------+-------------------------------------+
51+
+--------------------------------+------------------------------------+
52+
| Model | Description |
53+
+================================+====================================+
54+
| ``spp.hxl.import.profile`` | Configuration defining area |
55+
| | matching and rules |
56+
+--------------------------------+------------------------------------+
57+
| ``spp.hxl.aggregation.rule`` | Rule specifying what to aggregate |
58+
| | and how |
59+
+--------------------------------+------------------------------------+
60+
| ``spp.hxl.import.batch`` | Track one execution of profile |
61+
| | against HXL file |
62+
+--------------------------------+------------------------------------+
63+
| ``spp.hxl.import.mapping`` | Auto-detected column mapping |
64+
| | (adjustable pre-run) |
65+
+--------------------------------+------------------------------------+
66+
| ``spp.hxl.area.indicator`` | Aggregated indicator value stored |
67+
| | per area |
68+
+--------------------------------+------------------------------------+
69+
| ``spp.hxl.area.import.wizard`` | Wizard for uploading files and |
70+
| | previewing matches |
71+
+--------------------------------+------------------------------------+
7272

7373
Configuration
7474
~~~~~~~~~~~~~
@@ -94,15 +94,13 @@ UI Location
9494
Security
9595
~~~~~~~~
9696

97-
+----------------------------------+-----------------------------------+
98-
| Group | Access |
99-
+==================================+===================================+
100-
| ``spp_security.group_spp_admin`` | Full CRUD on profiles, rules, |
101-
| | indicators |
102-
+----------------------------------+-----------------------------------+
103-
| ``base.group_user`` | Read profiles/rules; create/edit |
104-
| | batches |
105-
+----------------------------------+-----------------------------------+
97+
+----------------------------------+------------------------------------------+
98+
| Group | Access |
99+
+==================================+==========================================+
100+
| ``spp_security.group_spp_admin`` | Full CRUD on profiles, rules, indicators |
101+
+----------------------------------+------------------------------------------+
102+
| ``base.group_user`` | Read profiles/rules; create/edit batches |
103+
+----------------------------------+------------------------------------------+
106104

107105
Extension Points
108106
~~~~~~~~~~~~~~~~
@@ -118,7 +116,7 @@ Dependencies
118116
~~~~~~~~~~~~
119117

120118
``spp_hxl``, ``spp_area``, ``spp_cel_domain``, ``spp_hazard``,
121-
``spp_security``, ``queue_job``
119+
``spp_security``, ``job_worker``
122120

123121
**Table of contents**
124122

spp_hxl_area/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"spp_cel_domain",
1818
"spp_hazard",
1919
"spp_security",
20-
"queue_job",
20+
"job_worker",
2121
],
2222
"external_dependencies": {
2323
"python": [

spp_hxl_area/readme/DESCRIPTION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Import HXL-tagged field data and aggregate to area-level indicators for humanita
1010
- Track imports as batches with state machine (draft → mapped → processing → done)
1111
- Auto-sync indicators to `spp.data.value` for CEL expression access
1212
- Link imports to hazard incidents for disaster response tracking
13-
- Process imports asynchronously via queue_job
13+
- Process imports asynchronously via job_worker
1414

1515
### Key Models
1616

@@ -56,4 +56,4 @@ After installing:
5656

5757
### Dependencies
5858

59-
`spp_hxl`, `spp_area`, `spp_cel_domain`, `spp_hazard`, `spp_security`, `queue_job`
59+
`spp_hxl`, `spp_area`, `spp_cel_domain`, `spp_hazard`, `spp_security`, `job_worker`

spp_hxl_area/static/description/index.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,15 @@ <h1>Key Capabilities</h1>
390390
processing → done)</li>
391391
<li>Auto-sync indicators to <tt class="docutils literal">spp.data.value</tt> for CEL expression access</li>
392392
<li>Link imports to hazard incidents for disaster response tracking</li>
393-
<li>Process imports asynchronously via queue_job</li>
393+
<li>Process imports asynchronously via job_worker</li>
394394
</ul>
395395
</div>
396396
<div class="section" id="key-models">
397397
<h1>Key Models</h1>
398398
<table border="1" class="docutils">
399399
<colgroup>
400-
<col width="46%" />
401-
<col width="54%" />
400+
<col width="47%" />
401+
<col width="53%" />
402402
</colgroup>
403403
<thead valign="bottom">
404404
<tr><th class="head">Model</th>
@@ -459,8 +459,8 @@ <h1>UI Location</h1>
459459
<h1>Security</h1>
460460
<table border="1" class="docutils">
461461
<colgroup>
462-
<col width="49%" />
463-
<col width="51%" />
462+
<col width="45%" />
463+
<col width="55%" />
464464
</colgroup>
465465
<thead valign="bottom">
466466
<tr><th class="head">Group</th>
@@ -469,12 +469,10 @@ <h1>Security</h1>
469469
</thead>
470470
<tbody valign="top">
471471
<tr><td><tt class="docutils literal">spp_security.group_spp_admin</tt></td>
472-
<td>Full CRUD on profiles, rules,
473-
indicators</td>
472+
<td>Full CRUD on profiles, rules, indicators</td>
474473
</tr>
475474
<tr><td><tt class="docutils literal">base.group_user</tt></td>
476-
<td>Read profiles/rules; create/edit
477-
batches</td>
475+
<td>Read profiles/rules; create/edit batches</td>
478476
</tr>
479477
</tbody>
480478
</table>
@@ -493,7 +491,7 @@ <h1>Extension Points</h1>
493491
<div class="section" id="dependencies">
494492
<h1>Dependencies</h1>
495493
<p><tt class="docutils literal">spp_hxl</tt>, <tt class="docutils literal">spp_area</tt>, <tt class="docutils literal">spp_cel_domain</tt>, <tt class="docutils literal">spp_hazard</tt>,
496-
<tt class="docutils literal">spp_security</tt>, <tt class="docutils literal">queue_job</tt></p>
494+
<tt class="docutils literal">spp_security</tt>, <tt class="docutils literal">job_worker</tt></p>
497495
<p><strong>Table of contents</strong></p>
498496
<div class="contents local topic" id="contents">
499497
<ul class="simple">

spp_import_match/README.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
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-
51
====================
62
OpenSPP Import Match
73
====================
84

9-
..
5+
..
106
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
117
!! This file is generated by oca-gen-addon-readme !!
128
!! changes will be overwritten. !!
@@ -44,7 +40,7 @@ Key Capabilities
4440
- Skip duplicate creation or update existing records when matches are
4541
found
4642
- Process imports with more than 100 records asynchronously using
47-
``queue_job``
43+
``job_worker``
4844
- Clear one2many/many2many associations before update to prevent
4945
duplicate entries
5046

@@ -107,7 +103,7 @@ Extension Points
107103
Dependencies
108104
~~~~~~~~~~~~
109105

110-
``base``, ``spp_base_common``, ``base_import``, ``queue_job``,
106+
``base``, ``spp_base_common``, ``base_import``, ``job_worker``,
111107
``spp_security``
112108

113109
**Table of contents**
@@ -149,4 +145,4 @@ Current maintainers:
149145

150146
This module is part of the `OpenSPP/OpenSPP2 <https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_import_match>`_ project on GitHub.
151147

152-
You are welcome to contribute.
148+
You are welcome to contribute.

spp_import_match/__manifest__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
"license": "LGPL-3",
1313
"development_status": "Beta",
1414
"maintainers": ["jeremi", "gonzalesedwin1123"],
15-
"depends": ["base", "spp_base_common", "base_import", "queue_job", "spp_security"],
15+
"depends": ["base", "spp_base_common", "base_import", "job_worker", "spp_security"],
1616
"data": [
17-
"data/queue_job_data.xml",
1817
"security/ir.model.access.csv",
1918
"views/import_match_view.xml",
2019
],

spp_import_match/data/queue_job_data.xml

Lines changed: 0 additions & 21 deletions
This file was deleted.

spp_import_match/models/base_import.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
from os.path import splitext
66

77
from odoo import _, models
8+
from odoo.exceptions import UserError
89
from odoo.models import fix_import_export_id_paths
910

10-
from odoo.addons.queue_job.exception import FailedJobError
11-
1211
from .base import _import_match_local
1312

1413
_logger = logging.getLogger(__name__)
@@ -202,5 +201,5 @@ def _import_one_chunk(self, model_name, attachment, options, context):
202201
result = model_obj.load(fields, data)
203202
error_message = [message["message"] for message in result["messages"] if message["type"] == "error"]
204203
if error_message:
205-
raise FailedJobError("\n".join(error_message))
204+
raise UserError("\n".join(error_message))
206205
return result

spp_import_match/readme/DESCRIPTION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Extends Odoo's base import functionality to match incoming records against exist
66
- Match on sub-fields within related records (e.g., household ID within individual)
77
- Apply conditional matching rules only when specific imported values are present
88
- Skip duplicate creation or update existing records when matches are found
9-
- Process imports with more than 100 records asynchronously using `queue_job`
9+
- Process imports with more than 100 records asynchronously using `job_worker`
1010
- Clear one2many/many2many associations before update to prevent duplicate entries
1111

1212
### Key Models
@@ -46,4 +46,4 @@ After installing:
4646

4747
### Dependencies
4848

49-
`base`, `spp_base_common`, `base_import`, `queue_job`, `spp_security`
49+
`base`, `spp_base_common`, `base_import`, `job_worker`, `spp_security`

0 commit comments

Comments
 (0)