
How to add watermark in Qweb report in odoo 17
Introduction
In professional reporting, watermarks serve a crucial purpose of indicating document status, preventing unauthorized use, and adding an extra layer of document identification. Odoo 17 provides flexible ways to add watermarks to QWeb reports, allowing developers to easily mark documents as draft, cancelled, or add branding elements.Watermarks are semi-transparent text or images overlaid on a document to provide additional context or visual information. In Odoo 17, you can implement watermarks directly within QWeb report templates using simple HTML and CSS techniques.
General Steps to Add a Watermark
First, find your report's QWeb template XML file
Locate the <template> tag where you want to add the watermark
Add a <div> with class "header" at the beginning of your template
Inside this header, add another <div> for your watermark
Style your watermark using basic CSS properties
The most important style properties for watermarks are:
opacity:Makes the watermark see-through (usually between 0.1 and 0.3)
position: fixed: Keeps the watermark in place
z-index: Makes sure the watermark stays behind your content
transform: rotate(): Helps you rotate text watermarks diagonally
Adding Text Watermark
This code adds text watermarks that change based on your document's state. When your document is in draft mode, it shows "Draft Copy", and when it's cancelled, it shows "Cancelled". The text is big, slightly see-through, and tilted at an angle. These settings make sure everyone can see the document's status while still being able to read what's underneath.
Adding Image Watermark
This code adds an image watermark to your PDF reports. The image is made see-through just like the text watermark, so it doesn't get in the way of reading your document. The code looks for your image in your module's files and places it in the background of your report.
Tips for Success
Start with a very light watermark (low opacity) and make it darker if needed
Test your reports with different page lengths to make sure the watermark looks good everywhere
Make sure your watermark doesn't cover up any important information
Always preview your report before saving changes
Conclusion
Adding watermarks to your Odoo reports is a simple way to make them look more professional and show their status clearly. Whether you choose text or images, these watermarks help everyone understand the state of your documents at a glance.Remember to test your watermarks with different documents to make sure they work well in all situations. With these instructions, you can now add watermarks to any report in your Odoo system!
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