Skip to content

Commit 386a33e

Browse files
[17.0][IMP] export_async_schedule: improve module ergonomy and functionnality
What has been added: - New way to group exports in a single/multiple emails - Views ergonomy redux (increase readability and add chatter history) - light refactoring (addition of a mixin)
1 parent 1acf4c1 commit 386a33e

23 files changed

+2163
-0
lines changed

export_async_schedule/README.rst

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
=============================
2+
Scheduled Asynchronous Export
3+
=============================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:170e4045b865c79a1eacbba69044d718814a3965bc3ad044ad2e4236f503153f
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github
20+
:target: https://github.com/OCA/queue/tree/17.0/export_async_schedule
21+
:alt: OCA/queue
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/queue-17-0/queue-17-0-export_async_schedule
24+
:alt: Translate me on Weblate
25+
.. |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=17.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Schedule automated exports sent by email at regular intervals (hours,
32+
days, weeks, months) to selected users.
33+
34+
**Export Groups** allow bundling multiple exports into a single email
35+
with multiple attachments - useful for consolidated reporting.
36+
37+
**Table of contents**
38+
39+
.. contents::
40+
:local:
41+
42+
Configuration
43+
=============
44+
45+
Creating an Export List
46+
-----------------------
47+
48+
1. Open any model's list view (e.g., Partners, Sales Orders)
49+
2. Select at least one record
50+
3. Click **Action → Export**
51+
4. Select fields to export
52+
5. Save the field list with a meaningful name
53+
54+
Configuring a Scheduled Export
55+
------------------------------
56+
57+
Navigate to **Settings → Technical → Automation → Scheduled Exports**
58+
and create a new record with:
59+
60+
- Model and export list (created above)
61+
- Export domain (filter records to export)
62+
- Export format (CSV or Excel)
63+
- Recipients (users who will receive the export)
64+
- Schedule (frequency and next execution date)
65+
- Language (for field labels in the export)
66+
67+
A cron job runs hourly to execute scheduled exports and groups.
68+
69+
Usage
70+
=====
71+
72+
When a scheduled export is configured, its execution is automatic based
73+
on the schedule.
74+
75+
Users receive an email with a download link for the exported file.
76+
Attachments remain in the database for 7 days by default (configurable
77+
via the ``attachment.ttl`` system parameter).
78+
79+
Export Groups
80+
-------------
81+
82+
Group multiple exports into a single email:
83+
84+
1. Navigate to **Settings > Technical > Automation > Grouped Scheduled
85+
Exports**
86+
2. Create a group specifying:
87+
88+
- Recipients (users with email addresses)
89+
- Email template
90+
- Exports to include (select from standalone exports or create new
91+
ones)
92+
- Schedule (interval, next execution, language)
93+
94+
3. Use **Send Test Email Now** to verify configuration
95+
96+
**Important**: When an export is added to a group, it automatically
97+
inherits the group's scheduling parameters (recipients, interval,
98+
language, etc.). Individual exports within a group cannot be executed
99+
separately - only the group's cron job triggers their execution as a
100+
batch.
101+
102+
Bug Tracker
103+
===========
104+
105+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_.
106+
In case of trouble, please check there if your issue has already been reported.
107+
If you spotted it first, help us to smash it by providing a detailed and welcomed
108+
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20export_async_schedule%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
109+
110+
Do not contact contributors directly about support or help with technical issues.
111+
112+
Credits
113+
=======
114+
115+
Authors
116+
-------
117+
118+
* Camptocamp
119+
* ACSONE SA/NV
120+
121+
Contributors
122+
------------
123+
124+
- Guewen Baconnier (Camptocamp)
125+
- `Komit <https://komit-consulting.com>`__:
126+
127+
- Cuong Nguyen Mtm <cuong.nmtm@komit-consulting.com>
128+
129+
- Stéphane Mangin (ACSONE SA/NV)
130+
131+
Maintainers
132+
-----------
133+
134+
This module is maintained by the OCA.
135+
136+
.. image:: https://odoo-community.org/logo.png
137+
:alt: Odoo Community Association
138+
:target: https://odoo-community.org
139+
140+
OCA, or the Odoo Community Association, is a nonprofit organization whose
141+
mission is to support the collaborative development of Odoo features and
142+
promote its widespread use.
143+
144+
.. |maintainer-guewen| image:: https://github.com/guewen.png?size=40px
145+
:target: https://github.com/guewen
146+
:alt: guewen
147+
.. |maintainer-stephanemangin| image:: https://github.com/stephanemangin.png?size=40px
148+
:target: https://github.com/stephanemangin
149+
:alt: stephanemangin
150+
151+
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
152+
153+
|maintainer-guewen| |maintainer-stephanemangin|
154+
155+
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/17.0/export_async_schedule>`_ project on GitHub.
156+
157+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

export_async_schedule/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import models
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2019 Camptocamp
2+
# Copyright 2026 ACSONE SA/NV
3+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
4+
5+
{
6+
"name": "Scheduled Asynchronous Export",
7+
"summary": "Generate and send exports by emails on a schedule",
8+
"version": "17.0.1.1.0",
9+
"author": "Camptocamp, ACSONE SA/NV, Odoo Community Association (OCA)",
10+
"license": "AGPL-3",
11+
"website": "https://github.com/OCA/queue",
12+
"category": "Generic Modules",
13+
"depends": [
14+
"base_export_async",
15+
"queue_job",
16+
"mail",
17+
],
18+
"data": [
19+
"security/ir.model.access.csv",
20+
"data/mail_template.xml",
21+
"data/ir_cron.xml",
22+
"views/export_async_schedule_group_views.xml",
23+
"views/export_async_schedule_views.xml",
24+
],
25+
"installable": True,
26+
"maintainers": ["guewen", "stephanemangin"],
27+
"development_status": "Beta",
28+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="ir_cron_export_async_schedule" model="ir.cron">
4+
<field name="name">Send Scheduled Exports</field>
5+
<field ref="model_export_async_schedule" name="model_id" />
6+
<field eval="True" name="active" />
7+
<field name="user_id" ref="base.user_root" />
8+
<field name="interval_number">1</field>
9+
<field name="interval_type">hours</field>
10+
<field name="numbercall">-1</field>
11+
<field eval="False" name="doall" />
12+
<field name="state">code</field>
13+
<field
14+
name="code"
15+
>model.search([('next_execution', '&lt;=', datetime.datetime.now())]).run_schedule()</field>
16+
</record>
17+
18+
<record id="ir_cron_export_async_schedule_group" model="ir.cron">
19+
<field name="name">Send Grouped Scheduled Exports</field>
20+
<field ref="model_export_async_schedule_group" name="model_id" />
21+
<field eval="True" name="active" />
22+
<field name="user_id" ref="base.user_root" />
23+
<field name="interval_number">1</field>
24+
<field name="interval_type">hours</field>
25+
<field name="numbercall">-1</field>
26+
<field eval="False" name="doall" />
27+
<field name="state">code</field>
28+
<field name="code">model._cron_run_scheduled_groups()</field>
29+
</record>
30+
</odoo>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="mail_template_export_group" model="mail.template">
4+
<field name="name">Export Group - Scheduled Reporting</field>
5+
<field name="subject">Scheduled Export - {{ object.display_name }}</field>
6+
<field name="model_id" ref="model_export_async_schedule_group" />
7+
<field name="auto_delete" eval="False" />
8+
<field name="body_html" type="html">
9+
<p>Please find attached the scheduled reports: <strong>
10+
<t t-out="object.display_name" />
11+
</strong>.</p>
12+
<p>This email contains the following exports:</p>
13+
<ul>
14+
<t t-foreach="object.export_ids" t-as="export">
15+
<li>
16+
<t t-out="export.ir_export_id.name or export.model_id.name" />
17+
</li>
18+
</t>
19+
</ul>
20+
<br />
21+
<p>
22+
<span
23+
style="color: #808080;"
24+
>This is an automated message, please do not reply.</span>
25+
</p>
26+
</field>
27+
</record>
28+
</odoo>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import export_async_schedule_mixin
4+
from . import export_async_schedule
5+
from . import export_async_schedule_group

0 commit comments

Comments
 (0)