Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
2c92b5d
[FIX] queue_job: cancel job waiting dependencies
ivantodorovich Jun 6, 2025
dd36d23
[FIX] queue_job: indicate that run_job need a read/write connection
vincent-hatakeyama Jan 24, 2025
e095b06
[IMP] queue_job: perform_enqueued_jobs should filter the context
florentx Jan 17, 2025
1cde603
[IMP] queue_job: explain context in docstring
florentx Feb 4, 2025
b493d54
[IMP] queue_job: use __slots__ for ChannelJob
florentx Jun 2, 2025
5e55362
[FIX] queue_job: missing slot for __weakref__
florentx Jun 3, 2025
72df400
[REF] queue_job: remove deprecated and not used methods
florentx Jun 2, 2025
56ea1c3
[FIX] queue_job: job runner open pipe that are never closed properly
petrus-v Mar 13, 2025
74037be
[IMP] queue_job: add Priority to Group-By and search
florentx May 26, 2025
f13f663
[IMP] queue_job: more efficient ChannelJob sorting
florentx Jun 3, 2025
e44df05
[IMP] queue_job: filter for retried jobs
florentx Jun 11, 2025
9e25208
[IMP] queue_job: set the columns optional in list view
florentx Jun 11, 2025
d589140
[IMP] queue_job: add index for efficient autovacuum
florentx Jun 25, 2025
d329517
[IMP] queue_job: requeue orphaned jobs
hoangtrann Nov 21, 2025
de0a304
Merge PR #785 into 17.0
OCA-git-bot Jan 2, 2026
ada1035
[BOT] post-merge updates
OCA-git-bot Jan 2, 2026
0edbe2f
Merge PR #795 into 17.0
OCA-git-bot Jan 2, 2026
9e4ef8b
[UPD] Update queue_job.pot
Jan 2, 2026
539246f
[BOT] post-merge updates
OCA-git-bot Jan 2, 2026
d7e3640
Update translation files
weblate Jan 2, 2026
3dbb0c5
Translated using Weblate (Italian)
mymage Jan 5, 2026
5487166
[IMP]queue_job: only subscribe job creator if indicated via boolean m…
GuillemCForgeFlow Jan 2, 2026
c7324db
[IMP] queue_job: query orphaned dead job not exist in lock table
hoangtrann Dec 31, 2025
58632be
Merge PR #863 into 17.0
OCA-git-bot Jan 7, 2026
7f5e5be
[BOT] post-merge updates
OCA-git-bot Jan 7, 2026
a8f2a04
Merge PR #865 into 17.0
OCA-git-bot Jan 13, 2026
1acf4c1
[BOT] post-merge updates
OCA-git-bot Jan 13, 2026
73c44c1
Add export_async_schedule
Nov 21, 2019
8458567
[UPD] README.rst
Nov 22, 2019
e64a229
Add end of month option for the schedules
Nov 22, 2019
f35c69f
[UPD] Update export_async_schedule.pot
oca-travis Jun 11, 2020
8c9a212
[UPD] README.rst
OCA-git-bot Jun 11, 2020
f9b9108
Added translation using Weblate (French)
ypapouin Nov 20, 2020
2d93fff
Translated using Weblate (French)
ypapouin Nov 20, 2020
cb027e5
Translated using Weblate (French)
ypapouin Feb 9, 2021
9e1bcd2
[IMP] export_async_schedule: black, isort, prettier
cuongnmtm Jan 11, 2023
81e5e5d
[MIG] export_async_schedule: Migration to 14.0
cuongnmtm Jan 11, 2023
6e1e719
[UPD] Update export_async_schedule.pot
Jun 21, 2023
ce8414f
[UPD] README.rst
OCA-git-bot Jun 21, 2023
7792bfb
Update translation files
weblate Jun 21, 2023
528c09a
[UPD] README.rst
OCA-git-bot Sep 3, 2023
b479f76
Apply new pre-commit conf
simahawk Nov 21, 2023
6d87325
[UPD] Update export_async_schedule.pot
Nov 21, 2023
c2725ec
[BOT] post-merge updates
OCA-git-bot Nov 21, 2023
9303f41
Update translation files
weblate Nov 21, 2023
3366294
Added translation using Weblate (Italian)
mymage Jan 31, 2024
8250263
[IMP] export_async_schedule: pre-commit auto fixes
StephaneMangin Feb 11, 2026
b58049b
[MIG] export_async_schedule: Migration to 17.0
StephaneMangin Feb 11, 2026
ca0a493
[DON'T MERGE] add test-requirements.txt
StephaneMangin Feb 11, 2026
f0409fb
[ADD] New module base_export_async to allow asynchronous export
apineux Apr 19, 2019
267e309
[IMP] add ir.model.access
apineux Apr 19, 2019
5791af6
[IMP] PEP8 & JS
apineux Apr 19, 2019
7afbece
[TEST] add test for base_export_async
apineux Apr 19, 2019
5c43e6b
[IMP] get email from current user
apineux Apr 19, 2019
5c68ec8
[IMP] Generated Readme
apineux Apr 23, 2019
a7ce70a
[IMP] URL to attachment to avoid email size limit
apineux Apr 25, 2019
c8e6084
[TEST] Check that cron delete attachment after TTL
apineux Apr 25, 2019
a635453
[IMP] Improve security for the asynchronous export by linking the att…
apineux Apr 25, 2019
f4591e6
[IMP] Improve the use of dates and config_parameter
apineux Apr 25, 2019
cf17274
[FIX] Can read odoobot email address
apineux Apr 30, 2019
d048f22
[IMP] Change Warning by UserError
apineux Apr 30, 2019
4fb5684
[IMP] Improve naming
apineux May 24, 2019
534ac91
[IMP] Split method + comments
apineux May 24, 2019
123c7bc
[IMP] Add the model description instead of name on the email subject
apineux Jun 19, 2019
4f6b0b4
[UPD] Update base_export_async.pot
oca-travis Jun 21, 2019
93442de
Added translation using Weblate (German)
marylla Jul 4, 2019
763e181
Translated using Weblate (German)
marylla Jul 4, 2019
8ab5a17
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Jul 25, 2019
5b0b2a2
Translated using Weblate (Chinese (Simplified))
liweijie0812 Jul 25, 2019
0af1b5c
[UPD] README.rst
OCA-git-bot Jul 29, 2019
11bc564
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Aug 29, 2019
cb1d986
Rename Chinese translation files
liweijie0812 Aug 30, 2019
9b3b2de
Set modules as uninstallable
Oct 1, 2019
620d7bc
Run pre-commit with black, isort, ...
Oct 4, 2019
3e63f2c
Support several recipient users in base_export_async
Nov 21, 2019
94db690
[UPD] Update base_export_async.pot
oca-travis Jun 11, 2020
9d39e45
[UPD] README.rst
OCA-git-bot Jun 11, 2020
7b27590
Update translation files
oca-transbot Jun 11, 2020
644bb24
Added translation using Weblate (French)
ypapouin Nov 20, 2020
c81d87a
Translated using Weblate (French)
ypapouin Nov 20, 2020
3c13565
Update translation files
oca-transbot Nov 22, 2020
5d2b634
Added translation using Weblate (Danish)
hhgabelgaard Feb 7, 2021
c6376fe
Translated using Weblate (Danish)
hhgabelgaard Feb 7, 2021
66a8fcd
Added translation using Weblate (Portuguese)
pedrocs-exo Mar 4, 2021
e737520
Translated using Weblate (Portuguese)
pedrocs-exo Mar 4, 2021
1d579da
Added translation using Weblate (Italian)
primes2h Jul 6, 2021
ea544bb
[IMP] base_export_async: black, isort, prettier
vincent-cowboy Jan 17, 2023
8902a35
[MIG] base_export_async: Migration to 15.0
vincent-cowboy Jan 17, 2023
16726b8
[REF] base_export_async: send mail via delay_export_mail_template
vincent-cowboy Jan 25, 2023
cab01b2
[UPD] Update base_export_async.pot
Jun 30, 2023
0024de3
[UPD] README.rst
OCA-git-bot Jun 30, 2023
bf63c18
Update translation files
weblate Jun 30, 2023
b50462d
[MIG] base_export_async: Migration to 16.0
Jul 10, 2023
05e792a
[16.0][MIG] base_export_async: Fix test
asierneiradev Jul 14, 2023
1ce3925
[16.0][MIG] base_export_async: Fix assets, imports and format
Jul 17, 2023
e62d48e
[UPD] Update base_export_async.pot
Jul 24, 2023
0a800b4
[UPD] README.rst
OCA-git-bot Jul 24, 2023
48a07d0
Added translation using Weblate (Spanish)
bencoronel Jul 24, 2023
05d3da1
Translated using Weblate (Spanish)
bencoronel Jul 24, 2023
1e32321
[UPD] README.rst
OCA-git-bot Sep 3, 2023
17939e4
Update translation files
weblate Oct 9, 2023
b206490
Translated using Weblate (Italian)
mymage Jan 11, 2024
c45e1d4
Translated using Weblate (Italian)
mymage Apr 4, 2024
ec4845b
Translated using Weblate (French)
didierdonze May 1, 2024
36d31d8
[FIX] Access error on ir.attachment create
hhgabelgaard Oct 31, 2023
f5b8e33
[BOT] post-merge updates
OCA-git-bot Jan 28, 2025
eeec5a4
Added translation using Weblate (Croatian)
uvid-gordana Feb 27, 2025
3c1f163
[ADD] base_export_async: make attachment accessible to portal users
hbrunn Mar 21, 2025
3dee329
[BOT] post-merge updates
OCA-git-bot Jan 2, 2026
8fcdd91
[IMP] base_export_async: pre-commit auto fixes
StephaneMangin Feb 11, 2026
7f53ab7
[MIG] base_export_async: Migration to 17.0
StephaneMangin Feb 18, 2026
d937023
[17.0][IMP] export_async_schedule: improve module ergonomy and functi…
StephaneMangin Feb 11, 2026
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ Available addons
addon | version | maintainers | summary
--- | --- | --- | ---
[base_import_async](base_import_async/) | 17.0.1.0.0 | | Import CSV files in the background
[queue_job](queue_job/) | 17.0.1.4.3 | <a href='https://github.com/guewen'><img src='https://github.com/guewen.png' width='32' height='32' style='border-radius:50%;' alt='guewen'/></a> | Job Queue
[queue_job](queue_job/) | 17.0.1.5.2 | <a href='https://github.com/guewen'><img src='https://github.com/guewen.png' width='32' height='32' style='border-radius:50%;' alt='guewen'/></a> | Job Queue
[queue_job_cron](queue_job_cron/) | 17.0.1.1.0 | | Scheduled Actions as Queue Jobs
[queue_job_cron_jobrunner](queue_job_cron_jobrunner/) | 17.0.1.1.0 | <a href='https://github.com/ivantodorovich'><img src='https://github.com/ivantodorovich.png' width='32' height='32' style='border-radius:50%;' alt='ivantodorovich'/></a> | Run jobs without a dedicated JobRunner
[queue_job_subscribe](queue_job_subscribe/) | 17.0.1.0.0 | | Control which users are subscribed to queue job notifications
[test_queue_job](test_queue_job/) | 17.0.1.1.0 | | Queue Job Tests
[test_queue_job](test_queue_job/) | 17.0.1.2.0 | | Queue Job Tests

[//]: # (end addons)

Expand Down
96 changes: 96 additions & 0 deletions base_export_async/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
=================
Base Export Async
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:da52a05130a89cd0000a39c9dd6315821387de2c310f9cf7cc1f7e6e8541fe55
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-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/17.0/base_export_async
:alt: OCA/queue
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/queue-17-0/queue-17-0-base_export_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=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Standard Export can be delayed in asynchronous jobs executed in the
background and then send by email to the user.

**Table of contents**

.. contents::
:local:

Usage
=====

The user is presented with a new checkbox "Asynchronous export" in the
export screen. When selected, the export is delayed in a background job.

The .csv or .xls file generated by the export will be sent by email to
the user who execute the export.

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_export_async%0Aversion:%2017.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.

Credits
=======

Authors
-------

* ACSONE SA/NV

Contributors
------------

- Arnaud Pineux (ACSONE SA/NV) authored the initial prototype.
- Guewen Baconnier (Camptocamp)
- Stéphane Mangin (ACSONE SA/NV)

Other credits
-------------

The migration of this module from 16.0 to 17.0 was financially supported
by:

- ACSONE SA/NV (https://www.acsone.eu/)

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/17.0/base_export_async>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions base_export_async/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
28 changes: 28 additions & 0 deletions base_export_async/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Base Export Async",
"summary": "Asynchronous export with job queue",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
"depends": ["web", "queue_job"],
"data": [
"security/ir.model.access.csv",
"security/ir_rule.xml",
"data/config_parameter.xml",
"data/cron.xml",
"data/mail_template.xml",
],
"demo": [],
"assets": {
"web.assets_backend": [
"base_export_async/static/src/xml/base.xml",
"base_export_async/static/src/js/list_controller.esm.js",
"base_export_async/static/src/js/data_export.esm.js",
],
},
"installable": True,
}
7 changes: 7 additions & 0 deletions base_export_async/data/config_parameter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="attachment_ttl" model="ir.config_parameter">
<field name="key">attachment.ttl</field>
<field name="value">7</field>
</record>
</odoo>
12 changes: 12 additions & 0 deletions base_export_async/data/cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="to_delete_attachment" model="ir.cron">
<field name="name">Delete Generated Exports</field>
<field name="model_id" ref="model_delay_export" />
<field name="state">code</field>
<field name="code">model.cron_delete()</field>
<field name='interval_number'>1</field>
<field name='interval_type'>days</field>
<field name="numbercall">-1</field>
</record>
</odoo>
24 changes: 24 additions & 0 deletions base_export_async/data/mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="delay_export_mail_template" model="mail.template">
<field name="name">Delay Export</field>
<field
name="subject"
>Export {{ object.model_description }} {{ datetime.date.today() }}</field>
<field name="model_id" ref="base_export_async.model_delay_export" />
<field name="auto_delete" eval="True" />
<field name="body_html" type="html">
<p>Your export is available <a
t-attf-href="{{ object.url }}"
target="_blank"
>here</a>.</p>
<p>It will be automatically deleted the <t t-out="object.expiration_date" />.</p>
<br />
<p>
<span
style="color: #808080;"
>This is an automated message please do not reply.</span>
</p>
</field>
</record>
</odoo>
66 changes: 66 additions & 0 deletions base_export_async/export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import io

from odoo.exceptions import UserError
from odoo.tools.misc import xlsxwriter
from odoo.tools.translate import _

from odoo.addons.web.controllers.export import ExportFormat, ExportXlsxWriter


class CleanedExportXlsxWriter(ExportXlsxWriter):
def __init__(self, field_names, row_count=0, decimal_places=None):
self.field_names = field_names
self.output = io.BytesIO()
self.workbook = xlsxwriter.Workbook(self.output, {"in_memory": True})
self.base_style = self.workbook.add_format({"text_wrap": True})
self.header_style = self.workbook.add_format({"bold": True})
self.header_bold_style = self.workbook.add_format(
{"text_wrap": True, "bold": True, "bg_color": "#e9ecef"}
)
self.date_style = self.workbook.add_format(
{"text_wrap": True, "num_format": "yyyy-mm-dd"}
)
self.datetime_style = self.workbook.add_format(
{"text_wrap": True, "num_format": "yyyy-mm-dd hh:mm:ss"}
)
self.worksheet = self.workbook.add_worksheet()
self.value = False
self.float_format = "#,##0.00"
self.monetary_format = f'#,##0.{max(decimal_places or [2]) * "0"}'

if row_count > self.worksheet.xls_rowmax:
raise UserError(
_(
f"There are too many rows ({row_count} rows, limit:"
f" {self.worksheet.xls_rowmax}) to export as Excel"
f"2007-2013 (.xlsx) format. Consider splitting the export."
)
)


class ExcelExport(ExportFormat):
def __init__(self, env):
self.env = env

@property
def content_type(self):
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"

@property
def extension(self):
return ".xlsx"

def from_data(self, fields, rows):
decimal_places = [
res["decimal_places"]
for res in self.env["res.currency"].search_read([], ["decimal_places"])
]
with CleanedExportXlsxWriter(fields, len(rows), decimal_places) as xlsx_writer:
for row_index, row in enumerate(rows):
for cell_index, cell_value in enumerate(row):
xlsx_writer.write_cell(row_index + 1, cell_index, cell_value)

return xlsx_writer.value
Loading
Loading