跳至内容
菜单
此问题已终结
1 回复
1065 查看

Hi Team,


We want to export normal qweb reports into PDF format.  We are using Odoo 17.0 community edition.  Is there any default feature or app available to enable this option.

Currently there is option to export into excel?  Also is there option to download into csv format.

Provide your inputs please.


Regards
Odoo@tenthplanet

形象
丢弃
最佳答案

PART 1: Export QWeb Reports to PDF in Odoo 17 Community


Step-by-Step to Export QWeb Reports to PDF

Precondition: You need to have the report action and QWeb template properly defined in your custom module.


Step 1: Define QWeb Template

In your custom module:

<template id="report_example_template">
    <t t-call="web.html_container">
        <t t-foreach="docs" t-as="doc">
            <div class="page">
                <h2>Report for <t t-esc="doc.name"/></h2>
                <p>Created on: <t t-esc="doc.create_date"/></p>
            </div>
        </t>
    </t>
</template>

Step 2: Define Report Action

<report
    id="action_report_example"
    model="your.model.name"
    string="Example Report"
    report_type="qweb-pdf"
    name="your_module.report_example_template"
    file="your_module.report_example_template"
    print_report_name="'Example Report - %s' % (object.name)"
/>


PART 2: Export to Excel and CSV in Odoo 17 Community

Step-by-Step to Export Data to Excel or CSV

Export to CSV (Built-in)

CSV export is available by default:

  1. Go to any List View (e.g., Sales Orders, Products).
  2. Select one or more records (checkbox).
  3. Click Action > Export.
  4. Choose fields to export.
  5. Choose format: CSV (default).
  6. Click Export.


Solution: Use a Free Community Module like export_xlsx

  1. Go to https://apps.odoo.com
  2. Search for: “Export XLSX” or report_xlsx module.
  3. Choose one compatible with Odoo 17 (check version).
  4. Install the module in your custom addons directory.
  5. Restart Odoo and update the apps list.
  6. Now, go to List View > Action > Export, and you'll have the XLSX format option.

Note: Ensure you have Python's xlsxwriter library installed (pip install XlsxWriter), as some modules require it.


Thanks & Regards,

Contact :-  DataInteger Consultancy Services LLP

形象
丢弃
相关帖文 回复 查看 活动
1
4月 25
1901
1
2月 25
1125
0
4月 25
1160
0
10月 24
1027
7
9月 24
24813