Why Customize Purchase Order Reports?
Creating a customized Purchase Order report in Odoo 18 isn’t just about changing the look of your documents. It’s about changing your procurement process into something more innovative, sharper, and custom-made for your business. Whether you’re a procurement officer, developer, or business owner, having the ability to generate reports that reflect your unique workflows, data points, and branding can provide a competitive edge.
Odoo is a powerful open-source ERP system that allows businesses to manage all their operations in one place. One of its strengths is its customizable reporting engine, especially for documents like invoices, sales orders, and purchase orders.
In this guide, we’ll walk you through creating a customized Purchase Order report in Odoo 18, giving you the tools to extract insights, simplify communication, and enhance professional presentation while harnessing the power and flexibility of Odoo’s backend architecture. Let’s dive in and turn your purchase data into a strong business asset.
What is a QWeb Report?
QWeb is Odoo’s templating engine for rendering reports. It allows you to write XML-based templates that dynamically insert data from Odoo models. QWeb reports are often used for PDF outputs like invoices and purchase orders.
Basic Report Architecture
An Odoo report consists of:
- A QWeb template (XML)
- A paper format record
- A report action record
- Optional Python helper functions (for complex logic)
Folder Structure for Custom Report
A typical folder structure looks like this:
my_module/
├── report/
│ ├── report_purchase_order.xml
│ └── report_templates.xml
├── views/
│ └── report_menus.xml
├── __manifest__.py
Creating the Template
The report’s core is the XML template, which defines how the data is displayed. Here is a working template:
PURCHASE ORDER
No
Part Number
Description
Qty
Unit Price
Discount Amount
VAT 5% Amount
Amount
Paper Format XML
This defines the layout properties like page size and margins:
Paper Format
A4
Portrait
115
25
5
5
100
Report Action XML
This links the model and template to create the report:
Purchase Order
purchase.order
qweb-html
my_module.report_purchase_order
my_module.report_purchase_order
report
Explanation of Key Parts
Section | What it does |
<t t-call=”web.basic_layout”> | Inherits base PDF layout used in Odoo reports |
<t t-foreach=”docs” t-as=”doc”> | Loops through purchase orders (usually one per report) |
image_data_uri(…) | Embeds the company logo as base64-encoded image |
t-field and t-esc | Outputs fields (with or without formatting) |
Footer section | Dynamically renders company contact information |
Benefits of Custom Purchase Order Reports in Odoo
Brand Consistency: Add your logo, layout, and business info for a professional appearance.
Clarity & Precision: Only show the most relevant information for stakeholders.
Flexibility: Easily modify templates as your business evolves.
Better Communication: Improve understanding between departments, vendors, and finance.
Data Insight: Use customized fields to analyze and audit purchasing trends.
Make Your Reports Work for You
- The report is fully dynamic and supports multi-company.
- You can add more fields, conditions, or sections based on business needs.
- Odoo’s templating allows using Python-like expressions inside XML with ease.
- You can replace the basic_layout with custom layouts for more control.



