跳至内容
菜单
此问题已终结
5 回复
19212 查看

I have looked through and tried all the suggestions from here and github.  I have checked my wkhtmltopdf version (0.12.1 patched with qt), I have tried changing the web.base.url parameter, adding the freeze parameter, etc.  My headers are still missing from PDF reports.  The system seems to be able to do the rest, as Bootstrap elements appear, as does the footer.  I did see this message show up once:

2015-01-20 17:16:21,146 22730 INFO JB-1-19 werkzeug: 127.0.0.1 - - [20/Jan/2015 17:16:21] "GET /web/binary/image?model=res.partner&field=image_small&id=3&resize= HTTP/1.1" 304 -

Any more things to try?  Would be nice if a fix for this was included in Odoo . . .

形象
丢弃

open your report from setting=>technical=>actions=>reports in your report click on Other Information tab you need to check "Add RML Header" then the header will appear in PDF report

编写者

Anyone have an answer for Odoo 8?

编写者 最佳答案

Aha!  I think I have hit on the answer, and the answer is that I'm a doofus!  In my custom XML template, I had selected the code block with:

<xpath expr="//div[@class='header']" position="replace"> . . . </xpath>

In my replacement code, I hadn't replaced the "<div class='header'>" tag.  Apparently, the header won't render in a PDF without that special div class!  Learn from my mistake!  :)

形象
丢弃

You are not the only doofus. :-) Thanks for sharing this info!

最佳答案

Hi,

I had same problem like you and i solved following step.

Settings -> Technical -> Parameters -> System Parameters -> find web.base.url and set value as http://0.0.0.0:[OdooPortNo] save and refresh page after try to print.

Thanks,

形象
丢弃
最佳答案

Hello Jeff Beidler,

There are two possiblites if your header is not appear in your report in odoo.

1) if wkthmltopdf lib not install in your system. (Install 0.11 or later version of wkhtmltopdf)

2) If you forgot call base template. (report.external_layout) inside your report template than you will not get header and footer in your report. Make sure you have follow this base structure for your report.

    <template id="your_unique_template_id">
            <t t-call="report.html_container">
                <t t-foreach="docs" t-as="var">
                    <t t-call="report.external_layout">  <!-- Make sure you have applied this template to your report. -->
                        <div class="page">

                                        <!-- Your report body-->

                       </div>

                 </t>
          </t>
      </t>
 </template>

Hope this will help.

Regards,

Anil.

形象
丢弃
最佳答案

hi, 

hear the problem was installation of wkhtmltopdf 

i have same issue in odoo 16 finally i corrected by proper installation of wkhtmltopdf

first we have to install wkhtmltopdf ubuntu 22 terminal

      1.    apt install wkhtmltopdf

      2. wkhtmltopdf --version 

      whether its 0.12.6 remove and download 0.12.5

      3.wget https://github\\.com/wkhtmltopdf/wkhtmltopdf/releases/download/0\\.12\\.5/wkhtmltox_0\\.12\\.5\\-1\\.bionic_amd64\\.deb

     \\ 4\\.sudo\\ dpkg\\ \\-i\\ \\ wkhtmltox_0\\.12\\.5\\-1\\.bionic_amd64\\.deb

sometimes\\ it\\ may\\ error\\ then\\ try\\ to\\ install\\ one\\ or\\ two\\ things 

    \\ 1\\.wget\\ http://archive\\.ubuntu\\.com/ubuntu/pool/main/o/openssl/libssl1\\.1_1\\.1\\.1\\-1ubuntu2\\.1\\~18\\.04\\.22_amd64\\.deb

   \\ 2\\.sudo\\ dpkg\\ \\-i\\ libssl1.1_1.1.1-1ubuntu2.1~18.04.22_amd64.deb

    3.sudo apt-get install xfonts-75dpi

    4.sudo apt-get update

    5.apt --fix-broken install


finally confirm  the "wkhtmltopdf version is  0.12.5"

形象
丢弃
最佳答案

open your report   from setting=>technical=>actions=>reports

in your report click on Other Information tab

you need to check "Add RML Header"  then the header will appear in PDF report

形象
丢弃
编写者

Is that a v7 thing? I don't see that tab in v8. Plus, I'm using Qweb, not RML.

相关帖文 回复 查看 活动
1
3月 15
7037
2
2月 24
5652
2
10月 22
6293
16
2月 17
47457
4
10月 16
5905