Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odgovori
7312 Prikazi

I am creating a report and want to add lines to a table. I have a python process that will create a linea with the <td> tags inside. However, this:

<table width="100%">
 <th></th>
 <th class="text-right">Ctd.</th>
 <th class="text-right">Importe</th>
 <t t-foreach="docs.filtra_pedidos(c)" t-as="l">
     <tr t-esc="l"></tr>
 </t>
 </table>

renders into this:



how can I get the <td> inside the <tr>tags?

Avatar
Opusti
Best Answer

You just need to add <td> tag inside the <tr> tag.

Try the following code:

<t t-foreach="docs.filtra_pedidos(c)" t-as="l">
<tr>
<td><span t-esc="l.name"/></td>
<td><span t-esc="l.partner_id.name"/></td>
<td><span t-esc="l.note"/></td>
</tr>
 </t>


Avatar
Opusti
Avtor Best Answer

let me clarify, this is the content of each "l":

['<td colspan="2">S00007</td><td>0.0</td>']

In each case it´s different, so if I add the <td> tag, it will just paste the text inside a cell, not a whole row.


Avatar
Opusti

You will have to add every field you want in the report in <td> tag.

Ex:

<td> <span t-esc="l.name"> </td>

<td> <span t-esc="l.partner_id.name"> </td>

<td> <span t-esc="l.note"> </td>

Related Posts Odgovori Prikazi Aktivnost
1
jul. 25
1979
1
maj 25
2115
1
apr. 25
2493
1
feb. 25
1778
0
okt. 24
1513