تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
20381 أدوات العرض

Hi,

When we try to print invoice with multiple pages the rest of the pages will have the table header and the first row from that page being printed on top of each other. 

we are using Odoo V8 and I tried edit the report_invoice_layouted and the property of the paper used but nothing seems to fix the header.

<?xml version="1.0"?>
<data inherit_id="account.report_invoice_document">
    <xpath expr="//table/tbody[@class='invoice_tbody']" position="replace">
        <t t-foreach="o.sale_layout_lines(invoice_id=o.id)" t-as="p">
            <!-- Name of the category -->
            <t t-call="sale_layout.category_template"/>

            <!-- Lines associated -->
            <t t-foreach="p['lines']" t-as="l">
                <tr>
                    <td><span t-field="l.name"/></td>
                    <td><span t-field="l.quantity"/></td>
                    <td class="text-right">
                        <span t-field="l.price_unit"/>
                    </td>
                    <td class="text-right">
                        <span t-field="l.price_subtotal" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.currency_id&quot;}"/>
                    </td>
                </tr>
            </t>

            <!-- Subtotal -->
            <t t-call="sale_layout.subtotal_template"/>

            <!-- Separator -->
            <t t-call="sale_layout.separator_template"/>

            <!-- Pagebreak -->
            <t t-if="'pagebreak' in p['category'] and p['category'].pagebreak is True">
                <t t-if="p_index &lt; p_size - 1">
                    
                            <![CDATA[
                                </tbody>
                            </table>
                            <p style="page-break-before:always;"> </p>
                            <table class="table table-condensed">
                            ]]>
                            <thead>
                        <tr>
                            <th>Description</th>
                            <th>Quantity</th>
                            <th groups="product.group_uom">Unit of measure</th>
                            <th class="text-right">Unit Price</th>
                            <th class="text-right">Amount</th>
                        </tr>
                    </thead>
                            <![CDATA[
                                <tbody>
                            ]]>
                </t>
            </t>
        </t>
    </xpath>
</data>

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Answering my own Question.

The issue is because of wkhtmltopdf.exe. you must use version 12.2.0.0 

 

more details www.odoo.com/forum/help-1/question/invoice-layout-issues-74445

الصورة الرمزية
إهمال
أفضل إجابة

Hello  
Emad Jaddo

Just use this class="table table-condensed" in your table tag. It will work and don't overlap the next page header content also.

<table class="table table-condensed" >

    <thead >

        <tr>

            <th>Description</th>

            <th class="hidden">Source Document</th>

            <th class="text-right">Quantity</th>

            <th class="text-right">Unit Price</th>

            <th t-if="display_discount" class="text-right">Disc.(%)</th>

            <th class="text-right">Amount</th>

        </tr>

    </thead>

الصورة الرمزية
إهمال
أفضل إجابة

I have the same problem in Ubuntu 16.04.

If I upgrade the version of wkhtmltopdf, the header, the footer and the css styles disappear


Note: I post this as an answer because the www.odoo.com server gives me a Bad Request Error if I try to post as a comment

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
ديسمبر 20
3246
1
نوفمبر 20
3157
3
يوليو 19
2936
1
ديسمبر 18
5003
3
يناير 23
3172