Skip to Content
Menu
This question has been flagged
2 Replies
8818 Views

Hii,

I have added watermark/background image on web.external_layout_boxed view. Here is the css.

<div class="article o_report_layout_boxed" style="background-image: url(http://www.domain.com/images/watermark.jpg);background-size:auto;background-position:center right;min-height:1080px;background-repeat:no-repeat;color:#4D4D4D;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>

inline css

background-image: url(http://www.domain.com/images/watermark.jpg);
background-size:auto;
background-position:center right;
min-height:1080px;
background-repeat:no-repeat;
color:#4D4D4D;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;"

Watermark applied successfully on first page of the pdf report, but if there are more pages the watermark dont repeat on other pages. Instead it goes down some part on to the second page and some on first page.

Any idea how to fix it.

Thanks,

Avatar
Discard
Best Answer

that's a serious problem in odoo 13 also .. anyway check my comment here

voir

Avatar
Discard
Best Answer

Hi Muhammad:

Put the style definition for the background image in the div used to define the page like so

<div class="page" style="background-image: url(http://.........>

Avatar
Discard
Author

Hii Paresh,

I am applying it from Settings > Document Template > Edit Layout > and applying directly on web.external_layout_boxed so it is applying on all reports in the company.

I am not applying it on a custom report.

In this case how to apply it on <div class="page" ??

Thanks,

Each report will have a <div class="page" within it's QWeb view. You'll need to put the style definition there if you want the watermark to appear on each page if the report.

Author

Do you have some sample code that how to apply custom css on <div class="page" on web.external_layout_boxed view.

Thanks,

You can use the "external_layout_background" template as a reference. It uses a background image for the report layout.

https://github.com/odoo/odoo/blob/12.0/addons/web/views/report_templates.xml#L166

Related Posts Replies Views Activity
0
May 24
327
2
May 24
961
3
Feb 24
812
2
Nov 22
3876
0
Apr 24
329