Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
10225 Lượt xem

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,

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

voir

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhấ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://.........>

Ảnh đại diện
Huỷ bỏ
Tác giả

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.

Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 24
1850
2
thg 5 24
3627
3
thg 2 24
3113
2
thg 11 22
5960
0
thg 4 24
1824