Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
157 changes: 157 additions & 0 deletions export_async_schedule/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
=============================
Scheduled Asynchronous Export
=============================

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

.. |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/export_async_schedule
: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-export_async_schedule
: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|

Schedule automated exports sent by email at regular intervals (hours,
days, weeks, months) to selected users.

**Export Groups** allow bundling multiple exports into a single email
with multiple attachments - useful for consolidated reporting.

**Table of contents**

.. contents::
:local:

Configuration
=============

Creating an Export List
-----------------------

1. Open any model's list view (e.g., Partners, Sales Orders)
2. Select at least one record
3. Click **Action → Export**
4. Select fields to export
5. Save the field list with a meaningful name

Configuring a Scheduled Export
------------------------------

Navigate to **Settings → Technical → Automation → Scheduled Exports**
and create a new record with:

- Model and export list (created above)
- Export domain (filter records to export)
- Export format (CSV or Excel)
- Recipients (users who will receive the export)
- Schedule (frequency and next execution date)
- Language (for field labels in the export)

A cron job runs hourly to execute scheduled exports and groups.

Usage
=====

When a scheduled export is configured, its execution is automatic based
on the schedule.

Users receive an email with a download link for the exported file.
Attachments remain in the database for 7 days by default (configurable
via the ``attachment.ttl`` system parameter).

Export Groups
-------------

Group multiple exports into a single email:

1. Navigate to **Settings > Technical > Automation > Grouped Scheduled
Exports**
2. Create a group specifying:

- Recipients (users with email addresses)
- Email template
- Exports to include (select from standalone exports or create new
ones)
- Schedule (interval, next execution, language)

3. Use **Send Test Email Now** to verify configuration

**Important**: When an export is added to a group, it automatically
inherits the group's scheduling parameters (recipients, interval,
language, etc.). Individual exports within a group cannot be executed
separately - only the group's cron job triggers their execution as a
batch.

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:%20export_async_schedule%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
-------

* Camptocamp
* ACSONE SA/NV

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

- Guewen Baconnier (Camptocamp)
- `Komit <https://komit-consulting.com>`__:

- Cuong Nguyen Mtm <cuong.nmtm@komit-consulting.com>

- Stéphane Mangin (ACSONE SA/NV)

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.

.. |maintainer-guewen| image:: https://github.com/guewen.png?size=40px
:target: https://github.com/guewen
:alt: guewen
.. |maintainer-stephanemangin| image:: https://github.com/stephanemangin.png?size=40px
:target: https://github.com/stephanemangin
:alt: stephanemangin

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-guewen| |maintainer-stephanemangin|

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

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

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

{
"name": "Scheduled Asynchronous Export",
"summary": "Generate and send exports by emails on a schedule",
"version": "17.0.1.1.0",
"author": "Camptocamp, ACSONE SA/NV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/queue",
"category": "Generic Modules",
"depends": [
"base_export_async",
"queue_job",
"mail",
],
"data": [
"security/ir.model.access.csv",
"data/mail_template.xml",
"data/ir_cron.xml",
"views/export_async_schedule_group_views.xml",
"views/export_async_schedule_views.xml",
],
"installable": True,
"maintainers": ["guewen", "stephanemangin"],
"development_status": "Beta",
}
30 changes: 30 additions & 0 deletions export_async_schedule/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="ir_cron_export_async_schedule" model="ir.cron">
<field name="name">Send Scheduled Exports</field>
<field ref="model_export_async_schedule" name="model_id" />
<field eval="True" name="active" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
<field name="state">code</field>
<field
name="code"
>model.search([('next_execution', '&lt;=', datetime.datetime.now())]).run_schedule()</field>
</record>

<record id="ir_cron_export_async_schedule_group" model="ir.cron">
<field name="name">Send Grouped Scheduled Exports</field>
<field ref="model_export_async_schedule_group" name="model_id" />
<field eval="True" name="active" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
<field name="state">code</field>
<field name="code">model._cron_run_scheduled_groups()</field>
</record>
</odoo>
28 changes: 28 additions & 0 deletions export_async_schedule/data/mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="mail_template_export_group" model="mail.template">
<field name="name">Export Group - Scheduled Reporting</field>
<field name="subject">Scheduled Export - {{ object.display_name }}</field>
<field name="model_id" ref="model_export_async_schedule_group" />
<field name="auto_delete" eval="False" />
<field name="body_html" type="html">
<p>Please find attached the scheduled reports: <strong>
<t t-out="object.display_name" />
</strong>.</p>
<p>This email contains the following exports:</p>
<ul>
<t t-foreach="object.export_ids" t-as="export">
<li>
<t t-out="export.ir_export_id.name or export.model_id.name" />
</li>
</t>
</ul>
<br />
<p>
<span
style="color: #808080;"
>This is an automated message, please do not reply.</span>
</p>
</field>
</record>
</odoo>
5 changes: 5 additions & 0 deletions export_async_schedule/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import export_async_schedule_mixin
from . import export_async_schedule
from . import export_async_schedule_group
Loading
Loading