Base report csv

Base report csv

by Contaura LLC · original work by Creu Blanca, OCA
report_csv
$ 29.00

Base module to create csv report

1.0

One purchase covers every version. Already bought it? Sign in.

Base report csv

This module provides a basic report class to generate csv report.

Table of contents

Usage

An example of CSV report for partners on a module called module_name:

A python class

from tulio 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

<report
    id="partner_csv"
    model="res.partner"
    string="Print to CSV"
    report_type="csv"
    name="module_name.report_name"
    file="res_partner"
    attachment_use="False"
/>
Technical namereport_csv
Module version12.0.1.0.1
Tulio versions1.0
CategoryProductivity
PublisherContaura LLC
Ported to Tulio, tested and supported by Contaura LLC.
Original authorsCreu Blanca, OCA
LicenseAGPL-3
Open source: you may use, change and share this module under its license. The price covers the Tulio port, its testing on Tulio 1.0 and the download.
Requires (Tulio core)base, web
Lines of code338
Downloads0
Released12/06/2026
12.0.1.0.1 Tulio 1.0 · 12/06/2026