İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
10218 Görünümler

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
Vazgeç
En İyi Yanıt

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

voir

Avatar
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici

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.

Üretici

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

İlgili Gönderiler Cevaplar Görünümler Aktivite
0
May 24
1849
2
May 24
3624
3
Şub 24
3110
2
Kas 22
5957
0
Nis 24
1813