Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
10200 Zobrazení

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
Zrušit
Nejlepší odpověď

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

voir

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
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

Related Posts Odpovědi Zobrazení Aktivita
0
kvě 24
1848
2
kvě 24
3624
3
úno 24
3105
2
lis 22
5955
0
dub 24
1790