Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
6 Răspunsuri
19451 Vizualizări

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>

Imagine profil
Abandonează

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>?


Cel mai bun răspuns

Hi,

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

<div style="page-break-after: always;"/>
Imagine profil
Abandonează
Cel mai bun răspuns

hello,

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

Thank you

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează