Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
6 Odpovědi
19407 Zobrazení

I have header and footer

I extend this header and this footer from "web_external_layout_standard"

Then, I created custom report template 

There may be too many products to be created. That's wayI need to divide the data in the table into pages

Also , the error is the like in the picture:

https://i.hizliresim.com/8YZDMk.png


<table class="table">

<tbody>

<t t-set="subtotal" t-value="0"/>

<t t-set="counter" t-value="0" />

<t t-foreach="o.invoice_line_ids" t-as="line">

<tr>

<td style="text-align:center;border:none;width:10%"><span t-esc="line_index + 1"/></td>

<td style="text-align:left;font-size:13px;width:50%;border:none;"><span t-field="line.name"/></td>

<td style="text-align:center;width:10%;border:none">

<span>

<t t-esc="'%.0f'%(line.quantity)"/>

</span>

</td>

<td class="col-xs-1" style="text-align:center;border:none;width:10%"><span t-field="line.price_unit"/></td>

<td class="col-xs-1" style="text-align:center;border:none;width:10%">

<span t-field="line.price_subtotal"

t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>

</td>

<t t-set="subtotal" t-value="subtotal + line.price_subtotal"/>

<t t-set="counter" t-value="counter + 1" />

</tr>

<t t-if="counter == 16 and line['price_subtotal']">

<tr class="text-right" style="border:0;border-top:0;">

<td colspan="6">

<strong>Ara Toplam:</strong>

<span>

<t t-esc="subtotal" t-options="{'widget':'monetary', 'display_currency':o.currency_id}"/>

</span>

</td>

</tr>

<t t-set="counter" t-value="0" />

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

</t>

<t t-if="line_index == (len(o.invoice_line_ids)-1)">

<tr class="text-right" style="border:0;border-top:0;">

<td colspan="6">

<strong>Toplam:</strong>

<t t-set="total" t-value="o.amount_total" />

<span>

<t t-esc="total" t-options="{'widget':'monetary', 'display_currency':o.currency_id}"/>

</span>

</td>

</tr>

</t>

</t>

</tbody>

</table>

Avatar
Zrušit

use <br/> or an empty <tr>

Autor

Hi Mr.Hilar,

Where will I use <br/> and empty <tr>?

Hi  Mr.Hilar,

Where will I use <br/> and  empty <tr>?


Nejlepší odpověď

Hi,

use always instead of auto in page-break, it maybe work.

<div style="page-break-after: always;"/>
Avatar
Zrušit
Nejlepší odpověď

hello,

Please help how to break the page after 10 line of item in the invoice.

Thank you

Avatar
Zrušit
Nejlepší odpověď

Hi,
Try this

    <table class="table">
<tbody>
<t t-set="subtotal" t-value="0"/>
<t t-set="counter" t-value="0"/>
<t t-foreach="o.invoice_line_ids" t-as="line">
<tr>
<td style="text-align:center;border:none;width:10%">
<span t-esc="line_index + 1"/>
</td>
<td style="text-align:left;font-size:13px;width:50%;border:none;">
<span t-field="line.name"/>
</td>
<td style="text-align:center;width:10%;border:none">
<span>
<t t-esc="'%.0f'%(line.quantity)"/>
</span>
</td>
<td class="col-xs-1" style="text-align:center;border:none;width:10%">
<span t-field="line.price_unit"/>
</td>
<td class="col-xs-1" style="text-align:center;border:none;width:10%">
<span t-field="line.price_subtotal"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<t t-set="subtotal" t-value="subtotal + line.price_subtotal"/>
<t t-set="counter" t-value="counter + 1"/>
<div style="page-break-after:auto;"/>
</tr>
<t t-if="counter == 16 and line['price_subtotal']">
<tr class="text-right" style="border:0;border-top:0;">
<td colspan="6">
<strong>Ara Toplam:</strong>
<span>
<t t-esc="subtotal"
t-options="{'widget':'monetary', 'display_currency':o.currency_id}"/>
</span>
</td>
</tr>
</t>
<t t-if="line_index == (len(o.invoice_line_ids)-1)">
<tr class="text-right" style="border:0;border-top:0;">
<td colspan="6">
<strong>Toplam:</strong>
<t t-set="total" t-value="o.amount_total"/>
<span>
<t t-esc="total"
t-options="{'widget':'monetary', 'display_currency':o.currency_id}"/>
</span>
</td>
</tr>
</t>
</t>
</tbody>
</table>

Regards

Avatar
Zrušit