Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
10217 Widoki

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,

Awatar
Odrzuć
Najlepsza odpowiedź

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

voir

Awatar
Odrzuć
Najlepsza odpowiedź

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://.........>

Awatar
Odrzuć
Autor

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.

Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
0
maj 24
1849
2
maj 24
3624
3
lut 24
3110
2
lis 22
5957
0
kwi 24
1813