This question has been flagged
11 Replies
17545 Views

Hi ! I'm on Odoo (v8).

Unable to fix this:

http://i.imgur.com/nSWiu6B.png?1

Anyone have a fix for that ? (either by changing css or changing qweb template)

Default qweb template for the report_saleorder_document vue.

<?xml version="1.0"?>
<t t-name="sale.report_saleorder_document">
    <t t-call="report.external_layout">
        <div class="page">
            <div class="oe_structure"/>
            <div class="row">
                <div class="col-xs-6">
                    <strong t-if="o.partner_shipping_id == o.partner_invoice_id">Invoice and shipping address:</strong>
                    <strong t-if="o.partner_shipping_id != o.partner_invoice_id">Invoice address:</strong>
                    <div t-field="o.partner_invoice_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;, &quot;fax&quot;], &quot;no_marker&quot;: true}"/>
                    <p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
                    <div t-if="o.partner_shipping_id != o.partner_invoice_id" class="mt8">
                        <strong>Shipping address:</strong>
                        <div t-field="o.partner_shipping_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;, &quot;fax&quot;], &quot;no_marker&quot;: true}"/>
                        <p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
                    </div>                        
                </div>
                <div class="col-xs-5 col-xs-offset-1">
                    <div t-field="o.partner_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>
                </div>
            </div>

            <h2>
                <span t-if="o.state not in ['draft','sent']">Order N° </span>
                <span t-if="o.state in ['draft','sent']">Quotation N° </span>
                <span t-field="o.name"/>
            </h2>

            <div class="row mt32 mb32" id="informations">
                <div t-if="o.client_order_ref" class="col-xs-3">
                    <strong>Your Reference:</strong>
                    <p t-field="o.client_order_ref"/>
                </div>
                <div t-if="o.date_order" class="col-xs-3">
                    <strong t-if="o.state not in ['draft','sent']">Date Ordered:</strong>
                    <strong t-if="o.state in ['draft','sent']">Quotation Date:</strong>
                    <p t-field="o.date_order"/>
                </div>
                <div t-if="o.user_id.name" class="col-xs-3">
                    <strong>Salesperson:</strong>
                    <p t-field="o.user_id.name"/>
                </div>
                <div t-if="o.payment_term" class="col-xs-3">
                    <strong>Payment Term:</strong>
                    <p t-field="o.payment_term"/>
                </div>
            </div>

            <table class="table table-condensed">
                    <thead>
                    <tr>
                        <th>Description</th>
                        <th>Taxes</th>
                        <th class="text-right">Quantity</th>
                        <th class="text-right">Unit Price</th>
                        <th groups="sale.group_discount_per_so_line">Disc.(%)</th>
                        <th class="text-right">Price</th>
                    </tr>
                </thead>
                <tbody class="sale_tbody">
                    <tr t-foreach="o.order_line" t-as="l">
                        <td>
                           <span t-field="l.name"/>
                        </td>
                        <td>
                            <span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
                        </td>
                        <td class="text-right">
                            <span t-field="l.product_uom_qty"/>
                            <span groups="product.group_uom" t-field="l.product_uom"/>
                        </td>
                        <td class="text-right">
                            <span t-field="l.price_unit"/>
                        </td>
                        <td groups="sale.group_discount_per_so_line">
                            <span t-field="l.discount"/>
                        </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.pricelist_id.currency_id&quot;}"/>
                        </td>
                    </tr>
                </tbody>
            </table>

            <div class="row">
                <div class="col-xs-4 pull-right">
                    <table class="table table-condensed">
                        <tr class="border-black">
                            <td><strong>Total Without Taxes</strong></td>
                            <td class="text-right">
                                <span t-field="o.amount_untaxed" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.pricelist_id.currency_id&quot;}"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Taxes</td>
                            <td class="text-right">
                                <span t-field="o.amount_tax" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.pricelist_id.currency_id&quot;}"/>
                            </td>
                        </tr>
                        <tr class="border-black">
                            <td><strong>Total</strong></td>
                            <td class="text-right">
                                <span t-field="o.amount_total" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.pricelist_id.currency_id&quot;}"/>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <p t-field="o.note"/>
            <p t-if="o.payment_term.note">
                <strong>Payment Term:</strong>
                <span t-field="o.payment_term.note"/>
            </p>
            <div class="oe_structure"/>
        </div>
    </t>
</t>

Avatar
Discard

You need to change the qweb template, if you post your code i will help in that.

Author

So far, I have the default template.

Best Answer

I struguled for days on this, and finally found out that the issue is because of wkhtmltopdf.exe. you must use version 12.2.0.0 

Once I downgraded, everything worked just fine. Make sure also you have set the paramaters for webkit_path and report_url http: //0.0.0.0:8069/ in the Settings > Technical > Paramaters > System Paramters

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

Avatar
Discard
Author Best Answer

Temporary solution:

Replace the thead with a p tag. This way, the column headers will only show on the first page, while still be aligned with the content.

Ugly solution, but that works for now.

Avatar
Discard
Best Answer

Hi,

The following are the types of page breaks used for the reports:

you can use any one of therse:

<p style="page-break-before:always;"> </p> (mostly reports used this type)

<p style="page-break-after:always"></p>

<div style="page-break-after: auto;"><span style="display: none;"> </span></div>

 <p style="page-break-inside: avoid">

 <div style="page-break-inside: auto"></div>

Avatar
Discard
Author

Thanks, I'll try these, though I don't know which one will work, and where.

Author

What was that ? Curious if your solution should work.

use the one which is bold letters..

Author

And I put that where ? On the thead ? Already tried. Sorry, didn't mess with styling for a while.

please explain your answer (thank you)

You can use it in any html tags in qweb reports

Best Answer

Please explain how to break the page after 10 line in the invoice?


Thank you,

Avatar
Discard