コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
25061 ビュー

I have odoo 12 community edition 

How to add an image in the header in purchase quotation and sale order pdf reports

and also add a background image in the body of the reports

please help me to fix this...

アバター
破棄
最善の回答

Hi,

There are lot of samples  for the same inside the odoo itself. To add the image in header you can see how the company logo is shown in the report header.

For adding image to report, try this:

<span t-field="line.image" t-options='{"widget": "image"}'/>

or

<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" class="float-left" alt="Logo"/>


Also you can check this video, in it, it is showing how to add image in pdf report: How To Create PDF Report in Odoo

Thanks

アバター
破棄
最善の回答

Hi,

i did the below mentioned steps for display the image into the qweb-pdf report.

Code:

<t t-set="base_url" t-value="request.env['ir.config_parameter'].sudo().get_param('web.base.url')"/>
<img t-att-src="'%s/your_module/static/src/img/signature.png' % base_url"
alt="Signature" width="180" height="160"/>

アバター
破棄
最善の回答

Hi,

By using the following code you can add image located in your directory

<img src='/module_name/static/src/img/name of image file' style="your custom style"/>
Add background image in pdf report 

View similar forum post before

https://www.odoo.com/forum/help-1/question/display-image-in-qweb-report-76746 

Hope it helps

アバター
破棄
関連投稿 返信 ビュー 活動
0
12月 18
5953
1
1月 20
4320
1
5月 19
3915
PDF reports 解決済
5
7月 25
2243
2
3月 24
2755