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

I have created a custom report but I am having a hard time getting the .pdf print with CSS styles applied.  In the web view by url it works, but the .pdf print not. 

What I have done:

'data': [
​'views/report_sale_order.xml',
​'views/sale_order_template.xml',
​'views/report_assets.xml', 
],
'assets': {
​'web.report_assets_common': [
​'custom_sale_report/static/src/scss/custom_font.scss'       
​]   
},

report_assets.xml

​xpath>
​template>
odoo>


What I have tried:

  • Add system parameter report.url same as base url
  • Add system parameter report.url http://127.0.0.1:8069



Update

After investigating logs adding the :8069 it just looks like odoo sh is blocking the port.... any suggestions to have a work around? I can';t imagine that odoo sh users are not having custom reports with custom css? 

Ảnh đại diện
Huỷ bỏ

What version Odoo are you running?

I am having same issue with 16...

Câu trả lời hay nhất

Hi,

Please change the asset to web.report_assets_pdf and try it again

eg:

'assets': {

    'web.report_assets_pdf': [

'custom_sale_report/static/src/scss/custom_font.scss'

    ]  

},



OR


Try to use inline styling


example:

<div class="container">

    //content

</div>


Hope it helps

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

Odoo 16, via odoo sh

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 23
11904
0
thg 1 21
804
2
thg 4 20
10082
3
thg 8 22
8047
0
thg 12 20
6565