Skip to Content
Menu
This question has been flagged
3 Replies
6244 Views

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
Discard
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
Discard
Author 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
Discard

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 Replies Views Activity
0
Oct 24
118
1
Apr 24
966
7
Sep 24
22447
1
Mar 24
277
0
Feb 24
413