Skip to main content

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runbot

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

Table of contents

Installation

Make sure you have xlsxwriter Python module installed:

$ pip3 install xlsxwriter

For testing it is also necessary xlrd Python module installed:

$ pip3 install xlrd

Usage

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

A python class

from odoo import models

class PartnerXlsx(models.AbstractModel):
    _name = 'report.module_name.report_name'
    _inherit = 'report.report_xlsx.abstract'

    def generate_xlsx_report(self, workbook, data, partners):
        for obj in partners:
            report_name = obj.name
            # One sheet by partner
            sheet = workbook.add_worksheet(report_name[:31])
            bold = workbook.add_format({'bold': True})
            sheet.write(0, 0, obj.name, bold)

To manipulate the workbook and sheet objects, refer to the documentation of xlsxwriter.

A report XML record

<report
    id="partner_xlsx"
    model="res.partner"
    string="Print to XLSX"
    report_type="xlsx"
    name="module_name.report_name"
    file="res_partner"
    attachment_use="False"
/>

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • ACSONE SA/NV

  • Creu Blanca

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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.

This module is part of the OCA/reporting-engine project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Metadata

Release files for odoo12-addon-report-xlsx 12.0.1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo12-addon-report-xlsx 12.0.1.0.5
File Interpreter ABI Platform
odoo12_addon_report_xlsx-12.0.1.0.5-py3-none-any.whl Python 3 none any Details

Release files / odoo12_addon_report_xlsx-12.0.1.0.5-py3-none-any.whl

Download URL odoo12_addon_report_xlsx-12.0.1.0.5-py3-none-any.whl
Size 48.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7e8ad2a0f7242671271e0909d2846647125dd570f651059bb9be116b1ae1d01
BLAKE2b-256 checksum
How to use checksums
1170896dda03241304f580c5d8f0dd6e86070030069e7d848e7175838fe667bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page