Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dd1d155
[19.0] queue: fix manifests, enable install for all addons\n\n- Fix m…
Sep 29, 2025
ecd7764
queue_job: restore dependency on base_sparse_field (module present an…
Sep 29, 2025
d60b1d0
queue_job: use tools.misc.SENTINEL and fix isinstance unions\n\n- fie…
Sep 29, 2025
aee4b0e
queue_job: v19-safe config fallback for jobrunner\n\n- Avoid deprecat…
Sep 29, 2025
945cdeb
[19.0] groups: replace deprecated category_id with privilege_id\n\n- …
Sep 29, 2025
5bb224d
[19.0] queue_job_channel: migrate _sql_constraints to models.Constrai…
Sep 29, 2025
3cdbc4a
[19.0] queue_job: replace self._cr and raw DDL\n\n- Use self.env.cr (…
Sep 30, 2025
3a695e1
[19.0] groups data: switch users->user_ids and use Command.link in XM…
Sep 30, 2025
3fbc0a9
[19.0] search view: drop widget=selection on company_id\n\n- Align wi…
Sep 30, 2025
eb43de8
[19.0] search view: drop python date filters (context_today - timedel…
Sep 30, 2025
751ba99
[19.0] search view: remove <group expand> wrapper; inline group-by fi…
Sep 30, 2025
4c65ca1
[19.0] clarify comment on removed date filters in search view\n\n- Ex…
Sep 30, 2025
1ef1491
[19.0] search views: align with v19 RNG\n\n- Remove <group expand> wr…
Sep 30, 2025
f69dc60
[19.0] search views: drop no-op domain=[] on group-by filters
Sep 30, 2025
80b0098
[19.0] base_import_async: drop deprecated @api.returns decorator\n\n-…
Sep 30, 2025
6e29b91
[19.0] tests: drop MetaCase usage (removed in v19)\n\n- OdooDocTestCa…
Sep 30, 2025
5d0d3a2
19.0: group_ids fixes + cron callback test stabilization
Sep 30, 2025
febddcc
19.0 tests: stabilize Odoo 19 behaviors
Oct 1, 2025
17f0133
tests(queue_job_cron): drop fragile cross-cursor partner name assert
Oct 1, 2025
ad2bd8a
queue_job_cron: 19.0-safe tests; upstream-like module behavior
Oct 1, 2025
4743a33
pre-commit: refresh README.rst and static descriptions
Oct 1, 2025
a6e2722
tests: create users in tests; drop base.user_demo
Oct 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions base_import_async/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===================
Asynchronous Import
===================
Expand All @@ -13,17 +17,17 @@ Asynchronous Import
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github
:target: https://github.com/OCA/queue/tree/18.0/base_import_async
:target: https://github.com/OCA/queue/tree/19.0/base_import_async
:alt: OCA/queue
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-base_import_async
:target: https://translation.odoo-community.org/projects/queue-19-0/queue-19-0-base_import_async
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=18.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -87,7 +91,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_.
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
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20base_import_async%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20base_import_async%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -149,6 +153,6 @@ 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.

This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/18.0/base_import_async>`_ project on GitHub.
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/19.0/base_import_async>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions base_import_async/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Asynchronous Import",
"summary": "Import CSV files in the background",
"version": "18.0.1.0.0",
"version": "19.0.1.0.0",
"author": "Akretion, ACSONE SA/NV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/queue",
Expand All @@ -20,6 +20,6 @@
"base_import_async/static/src/xml/import_data_sidepanel.xml",
],
},
"installable": False,
"installable": True,
"development_status": "Production/Stable",
}
2 changes: 1 addition & 1 deletion base_import_async/models/base_import_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def _link_attachment_to_job(self, delayed_job, attachment):
)
attachment.write({"res_model": "queue.job", "res_id": queue_job.id})

@api.returns("ir.attachment")
def _create_csv_attachment(self, fields, data, options, file_name):
# Odoo 19: @api.returns decorator removed; just return the recordset.
# write csv
f = StringIO()
writer = csv.writer(
Expand Down
38 changes: 22 additions & 16 deletions base_import_async/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Asynchronous Import</title>
<title>README.rst</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,16 +360,21 @@
</style>
</head>
<body>
<div class="document" id="asynchronous-import">
<h1 class="title">Asynchronous Import</h1>
<div class="document">


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="asynchronous-import">
<h1>Asynchronous Import</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:299c64b165f6348dfa062b8925a95235390daa6063964f21a5a1d0757cdf1614
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/base_import_async"><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-base_import_async"><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>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/base_import_async"><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-base_import_async"><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>
<p>This module extends the standard CSV import functionality to import
files in the background using the OCA/queue framework.</p>
<p><strong>Table of contents</strong></p>
Expand All @@ -392,7 +397,7 @@ <h1 class="title">Asynchronous Import</h1>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<p>The user is presented with a new checkbox in the import screen. When
selected, the import is delayed in a background job.</p>
<p>This job in turn splits the CSV file in chunks of minimum 100 lines (or
Expand All @@ -416,7 +421,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
</ol>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
<h2><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h2>
<ul class="simple">
<li>There is currently no user interface to control the chunk size, which
is currently 100 by default. Should this proves to be an issue, it is
Expand All @@ -425,33 +430,33 @@ <h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
</ul>
</div>
<div class="section" id="changelog">
<h1><a class="toc-backref" href="#toc-entry-3">Changelog</a></h1>
<h2><a class="toc-backref" href="#toc-entry-3">Changelog</a></h2>
<div class="section" id="section-1">
<h2><a class="toc-backref" href="#toc-entry-4">13.0.1.0.0 (2019-12-20)</a></h2>
<h3><a class="toc-backref" href="#toc-entry-4">13.0.1.0.0 (2019-12-20)</a></h3>
<ul class="simple">
<li>[MIGRATION] from 12.0 branched at rev. a7f8031</li>
</ul>
</div>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-5">Bug Tracker</a></h1>
<h2><a class="toc-backref" href="#toc-entry-5">Bug Tracker</a></h2>
<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:%20base_import_async%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20base_import_async%0Aversion:%2019.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-6">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-6">Credits</a></h2>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-7">Authors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-7">Authors</a></h3>
<ul class="simple">
<li>Akretion</li>
<li>ACSONE SA/NV</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-8">Contributors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-8">Contributors</a></h3>
<p>Sébastien Beau (Akretion) authored the initial prototype.</p>
<p>Stéphane Bidoul (ACSONE) extended it to version 1.0 to support
multi-line records, store data to import as attachments and let the user
Expand All @@ -473,23 +478,24 @@ <h2><a class="toc-backref" href="#toc-entry-8">Contributors</a></h2>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-9">Other credits</a></h2>
<h3><a class="toc-backref" href="#toc-entry-9">Other credits</a></h3>
<p>The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp</p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h3>
<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/18.0/base_import_async">OCA/queue</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/19.0/base_import_async">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>
</div>
</body>
</html>
10 changes: 5 additions & 5 deletions queue_job/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Job Queue
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github
:target: https://github.com/OCA/queue/tree/18.0/queue_job
:target: https://github.com/OCA/queue/tree/19.0/queue_job
:alt: OCA/queue
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-queue_job
:target: https://translation.odoo-community.org/projects/queue-19-0/queue-19-0-queue_job
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=18.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -661,7 +661,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_.
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
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20queue_job%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20queue_job%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -720,6 +720,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-guewen|

This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/18.0/queue_job>`_ project on GitHub.
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/19.0/queue_job>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 3 additions & 3 deletions queue_job/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "Job Queue",
"version": "18.0.2.0.2",
"version": "19.0.1.0.0",
"author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
"license": "LGPL-3",
Expand All @@ -24,10 +24,10 @@
],
"assets": {
"web.assets_backend": [
"/queue_job/static/src/views/**/*",
"queue_job/static/src/views/**/*",
],
},
"installable": False,
"installable": True,
"development_status": "Mature",
"maintainers": ["guewen"],
"post_init_hook": "post_init_hook",
Expand Down
5 changes: 3 additions & 2 deletions queue_job/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from psycopg2.extras import Json as PsycopgJson

from odoo import fields, models
from odoo.tools.misc import SENTINEL
from odoo.tools.func import lazy


Expand Down Expand Up @@ -38,7 +39,7 @@ class JobSerialized(fields.Json):
),
}

def __init__(self, string=fields.SENTINEL, base_type=fields.SENTINEL, **kwargs):
def __init__(self, string=SENTINEL, base_type=SENTINEL, **kwargs):
super().__init__(string=string, _base_type=base_type, **kwargs)

def _setup_attrs(self, model, name): # pylint: disable=missing-return
Expand Down Expand Up @@ -66,7 +67,7 @@ def convert_to_cache(self, value, record, validate=True):
def convert_to_record(self, value, record):
default = self._base_type_default_json(record.env)
value = value or default
if not isinstance(value, (str | bytes | bytearray)):
if not isinstance(value, (str, bytes, bytearray)):
value = json.dumps(value, cls=JobEncoder)
return json.loads(value, cls=JobDecoder, env=record.env)

Expand Down
2 changes: 1 addition & 1 deletion queue_job/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ def _get_retry_seconds(self, seconds=None):
break
elif not seconds:
seconds = RETRY_INTERVAL
if isinstance(seconds, (list | tuple)):
if isinstance(seconds, (list, tuple)):
seconds = randint(seconds[0], seconds[1])
return seconds

Expand Down
31 changes: 30 additions & 1 deletion queue_job/jobrunner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,43 @@
from odoo.tools import config

try:
# Preferred source when available: structured [queue_job] section provided
# by OCA's server_environment addon.
from odoo.addons.server_environment import serv_config

if serv_config.has_section("queue_job"):
queue_job_config = serv_config["queue_job"]
else:
queue_job_config = {}
except ImportError:
queue_job_config = config.misc.get("queue_job", {})
# Odoo 19: config.misc is no longer available. Build a minimal config
# from flat odoo.conf options so the runner works without server_environment.
queue_job_config = {}

# Merge flat odoo.conf options as a fallback (applies regardless of whether
# server_environment is installed). Precedence is enforced later where used:
# - Environment variables (highest) are read directly in runner functions
# - Then values coming from server_environment's [queue_job] section (above)
# - Finally flat odoo.conf options below (lowest)
#
# Supported flat options (under the [options] section in odoo.conf):
# queue_job_channels = root:2,mychan:1
# queue_job_jobrunner_db_host = localhost
# queue_job_jobrunner_db_port = 5432
# queue_job_jobrunner_db_user = odoo_queue
# queue_job_jobrunner_db_password = odoo_queue
_flat = {}
channels = config.get("queue_job_channels")
if channels:
_flat["channels"] = channels
for p in ("host", "port", "user", "password"):
v = config.get(f"queue_job_jobrunner_db_{p}")
if v:
_flat[f"jobrunner_db_{p}"] = v

# Do not override keys coming from server_environment if present
for k, v in _flat.items():
queue_job_config.setdefault(k, v)


from .runner import QueueJobRunner, _channels
Expand Down
21 changes: 19 additions & 2 deletions queue_job/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,26 @@ def _job_prepare_context_before_enqueue(self):

@classmethod
def _patch_method(cls, name, method):
"""Patch ``name`` with ``method`` preserving API metadata (Odoo 19).

Odoo 19 no longer exposes ``api.propagate``. We emulate the
propagation by using ``functools.update_wrapper`` and copying the
decorator metadata which Odoo relies on (see orm.decorators).
"""
origin = getattr(cls, name)
method.origin = origin
# propagate decorators from origin to method, and apply api decorator
wrapped = api.propagate(origin, method)
# carry over wrapper attributes (name, doc, etc.)
wrapped = functools.update_wrapper(method, origin)
# propagate common decorator metadata used by the framework
for attr in (
"_constrains",
"_depends",
"_onchange",
"_ondelete",
"_api_model",
"_api_private",
):
if hasattr(origin, attr):
setattr(wrapped, attr, getattr(origin, attr))
wrapped.origin = origin
setattr(cls, name, wrapped)
Loading