OdooWiki OCA HUB

SQL Export Excel

sql_export_excel folder_open OCA/reporting-engine open_in_new
Generic Modules/Others License: AGPL-3

Add the possibility to extract data from a sql query toward an excel file. It is also possible to provide an template excel file for a query. In this case, the data will be inserted in the specified sheet of the provided excel file. This is usefull when doing a lot of calculation in excel and the data is coming from Odoo.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Adds an Excel option to SQL exports, so query results can be downloaded as .xlsx files or injected into a pre-configured Excel template.

This module extends the existing SQL export feature with an Excel output format. On the SQL export form, users can now choose Excel as the file format. When Excel is selected, extra options appear: a checkbox to include or exclude column headers, and the ability to attach an Excel template file.

If a template is provided, the query results are written into that workbook instead of a blank one. Users specify which sheet, starting row and starting column the data should be placed in. The module checks that these positions are at least 1 and shows an error if they are lower. If the template has fewer sheets than the chosen sheet position, a validation message asks the user to adjust the setting.

Without a template, a new Excel workbook is created and the data starts at the first cell. The downloaded file uses the .xlsx extension. This is useful when calculations already exist in an Excel file and only the raw data needs to be refreshed from Odoo.

The module touches the sql.export model and its form view, and requires the openpyxl Python library to be installed.

Depends on

Models and fields (1)
  • sql.export · extends an existing modelheader, file_format, col_position (Column Position), row_position, attachment_id (Excel Template), sheet_position

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 6 confirmed, 3 with no information of 9 versions.

Sources · Odoo 17.0

Confirmed on 2026-11-03 in branch 17.0 of OCA/reporting-engine.

terminal Installation and usage

OCA documentation · Odoo 18.0

If you want Odoo to update an existing excel file, you should create an attachment with the excel file and configure this attachment on the query. Then, you can configure the query to indicate if Odoo should export the header and where it should insert the data. By default, it will insert it in the first sheet, at first row/column.

No verified information in OCA: Installation, Usage.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.