support Click to see our new support page.
support For sales enquiry!


customising pdf report in odoo 17

Technaureus Info Solutions Pvt. Ltd.April 30, 2024

Odoo ERP system is enterprise resource planning software used company wide for the management of business processes. Odoo provides seamlessly integrated functional business apps called Odoo apps that form an ERP solution when combined.

Likewise, a common business requirement is the ability to create documents to send to customers and to use internally. These reports can be used to summarise and display information in an organised template to support the business in different ways.

Now let’s look how to customize pdf report in Odoo 17 Invoice module.
Inherit account.move model
class AccountMove(models.Model):
_inherit = "account.move"

Next, we need to create an XML file for adding the report action.
<?xml version="1.0" encoding="utf-8"?>
<record id="action_report_account_move" model="">
<field name="name">Invoice Report</field>
<field name="model">account.move</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">custom_report.report_invoice </field>
<field name="report_file">custom_report.report_invoice</field>
<field name="binding_model_id" ref="invoice.model_account_move"/>
<field name="binding_type">report</field>

Next, we need to define a template for the qweb-pdf with id report_invoice
<?xml version="1.0" encoding="utf-8"?>
<template id=" report_invoice ">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
<div class="page">
<div class="oe_structure"/>
<h2>Invoice Report</h2>
<td><span t-field="o.partner_id"/></td>
<td><span t-field="o.invoice_date"/></td>
<td><span t-field="o.product_id"/></td>
<td><span t-field="o.price_unit"/></td>

This is how we can customize pdf reports in Odoo 17

LinkedIn LinkedIn

Subscribe to our Newsletter

Sign up to receive more information about our latest offers & new product announcement and more.