This module provides a basic report class to generate csv report.
auto_awesome What this module does
AI-generated from the code · Odoo 19.0Adds a new "csv" report type to Odoo, letting you define reports that download data as CSV files instead of PDF or HTML, with optional character encoding settings.
This module extends the standard report configuration so that a report can be set to the new "csv" type. When you edit a report under Settings > Technical > Reports, you can choose "csv" as the report type and then optionally set an encoding (for example cp932) and an error-handling option (Ignore or Replace) for characters that cannot be encoded.
- Reports of type csv are downloaded as .csv files from the usual report action, and the file name follows the report name or the report's print name.
- If the report is configured to save as an attachment, the generated CSV is stored in the database and reused for a single record.
- The module provides an abstract report model that developers can inherit to build their own CSV reports, plus a demo report "Print to CSV" on contacts (res.partner) that exports name and email with a semicolon delimiter and all values quoted.
- It touches the report action model
ir.actions.reportand adds the report type selection, encoding fields and a view to configure them.
No menus are added; configuration happens in the existing report form. The module is a technical base for other modules rather than an end-user feature by itself.
Depends on
Required by other modules
Models and fields (3)
- ir.actions.report · extends an existing modelencoding, report_type, encode_error_handling
- report.report_csv.abstract · new model
- report.report_csv.partner_csv · new model
Text generated by AI (DeepSeek) from reading the Odoo 19.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-03Confirmation status: 8 confirmed, 1 with no information of 9 versions.
Sources · Odoo 13.0
Confirmed on 2026-11-03 in branch 13.0 of OCA/reporting-engine.
terminal Installation and usage
OCA documentation · Odoo 19.0Configuration
Source · Odoo 19.0In case the exported CSV report should be encoded in another system than UTF-8, following fields of the report record (Settings \> Technical \> Reports) should be populated accordingly.
- Encoding: set an encoding system (such as cp932)
- Encode Error Handling: select 'Ignore' or 'Replace' as necessary.
- 'Ignore': in case of an encoding error, the problematic character will be removed from the exported file.
- 'Replace': in case of an encoding error, the problematic character will be replaced with '?' symbol.
- Leaving the field blank: in case of an encoding error, the report generation fails with an error message.
Usage
Source · Odoo 19.0An example of CSV report for partners on a module called module_name:
A python class :
from odoo import models
class PartnerCSV(models.AbstractModel): _name = 'report.report_csv.partner_csv' _inherit = 'report.report_csv.abstract'
def generate_csv_report(self, writer, data, partners): writer.writeheader() for obj in partners: writer.writerow({ 'name': obj.name, 'email': obj.email, })
def csv_report_options(self): res = super().csv_report_options() res['fieldnames'].append('name') res['fieldnames'].append('email') res['delimiter'] = ';' res['quoting'] = csv.QUOTE_ALL return res
A report XML record :
Update encoding with an appropriate value (e.g. cp932) as necessary.
No verified information in OCA: Installation.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
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.