Background Export Excel and Export CSV: run a large export in batches and e-mail the file
by Aerya IT Solutions https://aerya.net$ 54.79
Odoo 17, 18, 19 and 20, Community and Enterprise · Developed in the European Union by Aerya IT Solutions
Background Export Excel and Export CSV: run a large export in batches and e-mail the file
Large Excel and CSV exports from any list run on the server in batches, with each user’s own access rights. The browser does not wait for a long request: the file arrives by e-mail and stays in Odoo.
Batches on the server, resumed after a time limit
File by e-mail and under Exports, Background exports
Saved field lists shared with chosen groups
Runs on Odoo.sh and on-premise, not on Odoo Online (SaaS), where Odoo does not allow modules with Python code. Please buy the version that matches your database.
Screenshots of Odoo 19 Enterprise with the data of a fictitious company.
files compared with the standard export (CSV, Excel, import-compatible), record rules, field groups, companies, resume after a time limit, e-mail, cleanup, shared field lists, and browser tours of the export dialog
no warnings, on the four versions
Community and Enterprise, no other module needed
A large export freezes the browser or ends in a time out
Accountants export every journal item of a year, sales teams export the whole contact list, warehouse staff export every stock move. In Odoo the standard export builds the whole file in one request. With tens of thousands of records the browser waits, the server worker hits its time limit, and the user gets an error and no file. They try again with smaller filters, split the file by hand, or ask someone with database access.
What it does
The module adds one box to the standard export dialog. With it ticked, the export goes to a queue and the server builds the file in batches, as the user who asked for it. When the last batch is done, the Excel or CSV file is attached to an e-mail and kept in Odoo. Nobody waits in front of a spinning screen, and a long export does not fail on a time limit.
How it works, step by step
- Set the thresholds once. Open Settings and find the block Background exports. The defaults suit most databases.
- Select the records. In any list, select some rows, or all the records of the filter, and open Actions, Export.
- Pick the fields as usual. Choose the columns, the file format and the import-compatible mode in the standard dialog.
- Keep the background box ticked. It reads Build the file in the background and e-mail it to me. From the number of records you set it is ticked for you. Click Export: the dialog closes at once.
- Follow the progress. Open Exports, Background exports. Each export shows its status, the batches done and, after a failure, the reason. Cancel export stops a queued or running one, and Run again restarts a failed or cancelled one.
- Get the file. It arrives by e-mail, and Download on the export record gives it again. A pop-up tells the user when it is ready if Odoo is open.
Tick one box in the export dialog
Select the records of any list, open Actions, Export and pick the fields as usual. A new box, Build the file in the background and e-mail it to me, sends the export to the server instead of making the browser wait.
From 20,000 records (you choose the number) the box is already ticked.

Keep working while the file is built
The dialog closes at once. A scheduled job exports the records in batches of 2,000, keeps each batch, and writes the Excel or CSV file when the last batch is done. A long export survives the time limit of scheduled actions: the next run goes on from the last batch.
A pop-up says when the file is ready if Odoo is open.

The file arrives by e-mail
Each user gets the file attached to an e-mail, or a download link when it is larger than the limit you set (10 MB by default). Exports, Background exports lists every export with its progress, its file and the reason of a failure.
Users see their own exports; administrators see all of them.

The same file as the standard export
Every batch goes through the standard export of Odoo: same columns and labels, the import-compatible mode, the user's language and time zone, the same Excel formats for dates and numbers, and the same CSV.
Large sheets are written row by row to temporary files, not kept in memory.

Your rights, not the administrator's
The export runs as the user who asked for it: access rights, record rules, field groups, allowed companies and the right to export apply to every batch. Columns the user may not read are refused when the export is queued and checked again before each run.

Saved field lists shared by group
The field lists saved in the export dialog get a Shared with groups field. Without groups a list stays visible to everyone, as in standard Odoo; with groups only its author and the members see it, and only the author changes it.

Settings and options
| Batches | How many records are exported per batch (2,000 by default) and how many seconds of work the scheduled action does per run. |
| Export dialog | From how many records the background box is already ticked (20,000 by default, 0 means never). |
| Files | The e-mail size limit in MB (10 by default, 0 means always a download link) and how many days finished exports are kept (0 means kept). |
| Saved field lists | Menu Exports, Saved field lists, with the field Shared with groups. |
Two scheduled actions do the work: one builds the queued files (started at once when an export is queued, and every 15 minutes as a safety net), one removes old files every day. On a server with workers, the seconds of work per run stay under half of the CPU and real time limits.
What it does not do
- A grouped list exported with its group rows stops with a message. Remove the grouping, use the import-compatible mode, or export directly.
- More rows than an Excel sheet holds (1,048,575) stop with a message: use CSV.
- Columns the user may not read, and companies the user does not belong to, are refused when the export is queued.
- A batch that does not finish is tried again with half the records, and after five tries the export is marked failed with the reason. A file that cannot be written in time after three tries is marked failed too.
- A user can have at most five exports waiting or running at once.
- The Export All button of a list keeps its direct download.
- It does not change what the standard export writes: the file is the one the standard export would write in one go.
Requirements
- Odoo 17, 18, 19 or 20, Community or Enterprise.
- Odoo core only (Discuss, Settings and the web client). No other app needed.
- A host that allows modules with Python code: Odoo.sh or your own server. An outgoing mail server, so the file can be sent.
- English, Spanish and Romanian translations.
Frequently asked questions
Can a user export data they should not see?
No. Every batch runs as the user who asked, so access rights, record rules, field groups and allowed companies apply. The module never reads the data as administrator.
What if the server stops in the middle of an export?
The work is saved after each batch. The next run of the scheduled action goes on from the last batch.
Who sees the exports?
Each user sees their own exports and files. Administrators see all of them.
Is the file the same as the standard export?
Yes. Each batch goes through the standard export, with the same fields, labels, language, time zone and formats.
Can I limit who sees a saved field list?
Yes. Set Shared with groups on the list. Then only its author and the members of those groups see it, and only the author or an administrator changes it.
Does it keep the files forever?
No. Finished exports are removed with their files after the number of days you set in the settings.
Explore our other apps
More modules by Aerya IT Solutions for Odoo 20, built to work together.
Questions or a custom quote?
Write to info@aerya.ro for questions about the module, its installation or custom development.
aerya.net
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 1204 |
| Technical Name |
aerya_export_batch |
| License | OPL-1 |
| Website | https://aerya.net |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module