Odoo Help


Watermarking in odoo 8 reports

on 1/11/15, 6:14 AM 4,865 views

I would like add watermarking image in my custom report. Is it possible in odoo8 qweb template?



| 8 8 8

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

On 1/11/15, 6:21 AM

Hi Ayyappan

The simple answer is yes. You can add css to elements in QWeb reports so you can also add images in it for example.
You can do anything you'd like with CSS so just host an image somewhere and add an element to your report which you style as you'd like.

Update: Here is a sample.Place this under /addons/sale/views/report_saleorder.xml wherever you want the watermark to be printed.

<t t-if="o.client_order_ref">
    <div class="watermark" style="position:absolute;opacity:0.25;font-size:3em;width:100%;text-align:center;z-index:1000;">
        <p t-field="o.client_order_ref"/>

Example in the layout: 

Thanks for reply Yenthe. For an example, i have to print my sale order report with watermarking image. The watermarking text must be the sale order reference number. Is it possible? If it is, can you help me to get this? Give me some example codes...

on 1/12/15, 12:28 AM

Updated with a sample. yourRef is the reference that you fill in. You can make it less opacity, bigger, smaller, ... its just an example :)

on 1/12/15, 2:13 AM

Thanks a lot Yenthe. :-)

on 1/12/15, 3:44 AM

No problem, best of luck!

on 1/12/15, 3:54 AM
Hi Ayyappan,

Not directly.. You would need to create some sort of Qweb loop or something then :s
Couldn't think of a direct, working solution really!


2015-03-16 14:24 GMT+01:00 Ayyappan <s.ayyappan38-gmail.com@mail.odoo.com>:

Is it possible to repeat the watermark for all the pages in pdf report? Above example is printing the watermark only in the first page of the report.

Sent by Odoo Inc. using Odoo about Forum Post False

on 3/17/15, 2:48 AM
matt crouch
On 2/8/16, 3:16 PM

To include a watermark in every page of the generated PDF, you can modify either the CSS which is used in every page, or modify the general template to include the watermark. By default, I believe the CSS class is 'page', and the XML ID of the view creating the header for external PDFs is 'external_layout_header' 

If desired, you can add a field for each object , say, 'watermark_content', and then use a t-if as above to display the content. Eg:

<t t-if="o.watermark_content">

  <div style="opacity:25%;width:100%;color:#CCC;z-index:1000;text-align:center;"  t-field="o.watermark_content"/>


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 1/11/15, 6:14 AM
Seen: 4865 times
Last updated: 2/8/16, 3:16 PM