Secure Public Invoice Preview in Odoo Using Access Tokens and PDF Generation

August 28, 2025 by
admin


                                                                                                                 



Secure Public Invoice Preview in Odoo Using Access Tokens and PDF Generation

Overview
For many businesses, especially those working with partners or customers on credit terms, sharing outstanding invoice details securely and professionally is crucial. Odoo provides a robust way to achieve this using QWeb PDF reports and custom HTTP controllers.
In this article, we’ll walk through an implementation where a public link allows customers to preview or download their outstanding invoices, using a secure UUID-based access token. This ensures that sensitive financial documents are shared securely without requiring the user to log in.


Implementation Details
1️. Generating a Secure Access Token
Each invoice record is assigned a unique token for secure access:

This token is used to construct the public URL that allows access to the invoice PDF.

2️.Controller for Public Access
The controller /public/invoice/<token> checks the token and returns a PDF rendered from a QWeb report:


3️. Triggering Access Token Creation from Button
When a user triggers the Outstanding Report PDF action, tokens are created if they don't exist:

In the xml template define like this:

This approach ensures that the customer can click on a particular invoice number and get a PDF download of the full invoice.
Benefits
  • Secure Access: Only users with the token can view/download the invoice.
  • No Login Required: Useful for external users or customers.
  • Professional Format: Uses Odoo’s native PDF reporting for branding and structure.
  • One-click Download: Simplifies the customer experience.


 Conclusion
Implementing secure public invoice access in Odoo using UUID-based tokens and dynamic PDF generation not only enhances customer convenience but also ensures data privacy and professional communication. This approach strikes the perfect balance between accessibility and security, empowering businesses to share financial documents seamlessly without compromising control.

If you are looking for an ERP implementation partner with diverse industry experience feel free to contact us. Zesty Beanz Technologies is headquartered in Trivandrum Kerala,  We have proven track record of successful implementations across the world in various sectors including Odoo for Manufacturing, Odoo for Trading, Odoo for FMCG, Odoo for Oil & Gas, Odoo for Diary, Odoo for Pharma, Odoo for Cosmetic Clinic, Odoo for Contracting Companies, Odoo for HVAC, Odoo for Logistics, Odoo for Automobile, Odoo for Laundry, Odoo for Field Service, Odoo for E-Commerce & many more

ZestyBeanz offers Developer / Consultant outsourcing programs, Chat with us in Whatsapp and Hire Odoo Developers, Mobile Application Developers, Consultants.
#OdooKerala #OdooKochi #OdooTrivandrum #OdooERP #ProjectManagement #OdooVansales #HireOdooDeveloper