How to Create Qweb Report in Odoo 16?
Last updated: November 24, 2022 Read in fullscreen view



- 21 Apr 2021
Most frequently asked questions about Odoo ERP 987
- 20 Oct 2022
Odoo roadmap for beginners and small businesses 799
- 10 Aug 2021
Build A Marketplace Website with Odoo ecommerce 610
- 29 Nov 2019
Odoo Website Builder Allows You to Make Your Own Website 603
- 18 May 2022
Odoo Employee Contract Portal Self Service 552
- 10 Apr 2022
Odoo Dealership Management 446
- 01 Jan 2023
Senior Odoo Business Developer - Job Detail 406
- 25 Dec 2021
Compare Odoo Studio vs QuickBase vs OutSystems 384
- 15 Jun 2022
ERP Implementation Strategies: Big Bang and Phased rollout 375
- 08 Aug 2022
Scale-up! The ultimate business game to learn business operations before you get started 337
- 14 Dec 2021
Odoo - the Right Software for Your Digital Transformation? 301
- 09 Nov 2021
Frequently Asked Questions about Odoo 270
- 01 Nov 2023
Unlocking the power of Odoo 17 - What are the new and improved features? 267
- 10 Feb 2022
Odoo Implementation - Basics of the QuickStart Methodology 263
- 18 Mar 2020
Automate Recruitment with Odoo: Work smarter, not harder 255
- 19 Jan 2022
TIGODOO - The leading player in the digital transformation market 245
- 08 Aug 2021
XERO vs ODOO: Which fits your needs? 242
- 03 Nov 2021
7 phases of Odoo Implementation and Development: Can they be outsourced? 241
- 17 Feb 2022
10 services of Odoo Development for streamlining your business 235
- 12 Oct 2022
Why is ODOO end-to-end business management software? 234
- 03 Jan 2022
ERP System Scalability—A Tale of Two Companies (Part 3) 226
- 08 Nov 2021
Why Odoo is considered best for streamlining your business? 225
- 10 Feb 2022
Odoo Implementation Services - Let Us Be the Icing 219
- 25 Jul 2022
Govern your Business with Odoo - One Solution To Many Challenges 217
- 19 Jul 2022
Odoo vs Sage Comparison 217
- 11 Sep 2022
Odoo - a product-market fit for a radical and meaningful transformation of SMEs in Japan 216
- 19 Oct 2021
The Workplace of the Future: Gamification to Encourage and Reward Employees 206
- 01 Oct 2022
Odoo 16 will Disrupt The ERP Mid-Market with stunning features 204
- 07 Feb 2023
Odoo Consulting Services in Vietnam 201
- 02 Jan 2022
ERP Implementation Cost and Duration—A Tale of Two Companies (Part 2) 194
- 04 Jan 2022
Freedom of ERP Deployment Choice—A Tale of Two Companies (Part 4) 168
- 07 Nov 2022
The Future of Odoo Consulting 167
- 08 Nov 2022
Considerations in revolutionizing your business with Odoo 164
- 02 Oct 2022
Odoo: The Disruptor of Traditional ERP in the Age of AI and Blockchain 161
- 19 Apr 2023
A Deep Dive into Odoo: Benefits, Drawbacks, Strategic Fit, and Investment Models 160
- 09 Apr 2022
Comparing Features for Odoo ERP with ERPNext 142
- 19 Sep 2022
Comparison between Odoo and SAP: It doesn't matter whether a cat is black or white, as long as it catches mice 134
- 23 May 2022
4 Strategies of Odoo ERP Implementation 130
- 01 Jan 2022
Planning for Successful ERP Implementation Projects (Part 1) 125
- 16 Mar 2022
Digital Transformation With Odoo: an ERP made for you as SME and grow with you? 122
- 01 Feb 2024
Employee Attendance Using Camer AI 122
- 08 Aug 2022
Why is Odoo growing faster than other ERP software systems? 114
- 01 Mar 2024
Odoo Ecosystem - ALL-IN-ONE BUSINESS MANAGEMENT SOFTWARE 99
- 04 Apr 2023
Odoo: A Re-Birth for Enterprise Software 92
- 03 Apr 2023
Odoo ERP - "Swiss army knife" approach for all business solutions 89
- 18 Mar 2025
Odoo HRMS Software for Efficient HR Management in Dubai Businesses 50
- 13 Jan 2025
Why Businesses Are Choosing Microsoft Dynamics 365 Business Central Over NetSuite 48
- 01 Apr 2025
How to Manage Social Media Marketing with Odoo 46
- 01 Jan 2024
Odoo: The Small Business Game-Changer — Cost Savings and Enhanced Productivity 39
- 15 Jul 2025
Steps to Successful Odoo Implementation 29
- 09 Apr 2025
Odoo Migration Best Practices: A Complete Guide to Upgrading Your ERP System 10
An ERP system contains many modules for performing various operations to run a business workflow efficiently. Despite this, every organization wants to know its progress, and they have to present the growth to their boards or authorities, which is when reports come in handy. Therefore, Odoo provides various report projections, such as PDFs, graphical presentations, pivot tables, etc.
Odoo uses Qweb as a reporting engine or template engine. By using Qweb, we can create reports in Odoo. Reports can be designed using XML as per your requirements. Odoo Qweb Report is also an OpenERP/Odoo XML based reporting engine. It allows us to manipulate data easily by using XML
In Odoo, to render PDFs from the Qweb templates, we used Wkhtmltopdf. Since the templates are defined in HTML format in the previous section, wkhtmltopdf will render the PDF report from Qweb.
Odoo reports are working with report templates and report actions. I used the report templates in report action to identify which template you want to select. When a report is printed, a report action is triggered that can either be called from the Print menu or from a Python function. You can also set a custom page format specified in your report action.
Report Action
Odoo has different kinds of actions for different operations. For example, reports are generated when the report action is triggered. The model will recognize the report action ‘ir.actions.report’ used in the record.
You can specify your report action by adding an xml file in your report directory. Here is an example of a report action.
<record id="action_report_fleet_id" model="ir.actions.report"> <field name="name">Fleet ID</field> <field name="model">fleet.fleet</field> <field name="report_type">qweb-pdf</field> <field name="report_name">fleet..report_fleet_id</field> <field name="report_file">fleet.report_fleet_id</field> <field name="print_report_name">Vehicle - %s' % (object.name)</field> <field name="binding_model_id" ref="model_fleet_fleet"/> </record>
Name: Specify the name of the report.
Model: Specify the model name here where you can fetch the data for the report. model is a mandatory field.
report_type: Here, you can specify the report type. Mainly it stores two values, qweb-pdf and qweb-html. The default value of report_type is qweb-pdf.
report_name: Here, you can specify the external_id of the report template and is a mandatory field
print_report_name: You can use python expressions to generate report filenames.
binding_model_id: If you want to print the report from the Print Action button inside a view, you can bind the action with the corresponding model.
paperformat_id: You can specify the paper format external id here. If it is not specified, take the default paper format the company will use.
Define Odoo Qweb Report Template
You can create an xml file inside your report directory. By using the HTML, the templates are designed. You can specify the structure of your report inside the <template> tag. By using the <t-call=” ”/> tag, you can call the other templates in your custom reports.
<template id="report_fleet_id"> <t t-call="web.html_container"> <t t-foreach="docs" t-as="o"> <t t-call="web.external_layout"> <div class="page"> <h2>Report title</h2> <p>This object's name is <span t-field="o.name"/></p> </div> </t> </t> </t> </template>
The Id report_fleet_id is the external id which you specify inside your report action. For example, you can specify the header and footer of your report by using <header> and <footer> tags, or you can call an external id by using the <t-call=” ”/> tags.
You can also generate qweb reports from the wizard. Thus in odoo, one can easily create/custom qweb reports.
If you plan a new ERP Software implementation and you have heard about Odoo and got attracted by the Odoo ERP platform, decided to use it but don’t have time, resources, or knowledge to manage this yourself, thereby looking for professional help, then you have come to a right place. TIGO has implemented and delivered our own customized Odoo applications with minimal Odoo implementation cost for more than 5 years.