콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
7063 화면

I'm using Odoo 14 community. I have a few custom reports. In this report while I print, the header or footer is missing in some prints, sometimes the header or footer comes and sometimes not. I updated the latest addons and downgraded the wkhtmltopdf 0\.12\.1\.5\ to\ wkhtmltopdf\ 0.12.1.3.

아바타
취소

did you solve this problem?

베스트 답변

We also faced the same issue at random times, the qweb report  header content is shown blank. 

Even after trying out various options like adding report.url and other general solutions, it still gave the same blank header at frequent times. 

After doing an extensive code walk through we found that report header is loading below java script through the file report_templates.xml.

function subst() {...} 

Further debugging lead us to the ir_actions_report.py where it controls the addition of this script in the header and footer html. 

header = layout._render(dict(subst=True, body=lxml.html.tostring(header_node), base_url=base_url))

We gave this subst=False in order not to generate the java script content and it did not load the script as expected. 

How ever the issue still persisted and it gave us the though that, it is indeed the java script loading issue at wkhtmltopdf module. 

So we went through the wkhtmltopdf documentation and identified that there is a parameter '--javascript-delay' which can be used to control the loading of javascript.

Hence we added below line of code in ir_action_report.py file  to add this parameter to the wkhtml argument list. 

command_args.extend(['--javascript-delay', str(1000)])

This gave us the perfect solution for this issue. 

But we are curious to know why odoo load the above java script in the report html as it simply take the back up of the header text and append it back. 

Please check and let me know if this works out for your case


아바타
취소
관련 게시물 답글 화면 활동
0
7월 22
40
1
3월 21
10739
1
8월 24
1961
2
1월 23
7432
0
1월 22
2228