Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
15594 Vues

Hello there:

I am trying to make an HTML report using qWeb in Odoo. Table I have to print has variable columns, and those columns have variable colspan values, so I defined a method in Python in order to return the header and colspan of that columns. Method returns something like this:

    OrderedDict({'header 1' : 6, 'header 2' : 6, 'header 3' : 2, 'resume' : 2})

In qWeb code I wrote this:

    <td align="center" style="border:1px solid black;" colspan="<t t-esc='partial_value' />" ><b><t t-raw="partial" /></b></td>

The name of the column (the header) is printed successfully, but the colspan value is raising an exception (XMLSyntaxError: Unescaped '<' not allowed in attributes values). I also tried tag t using t-esc... It raised same error.

So, how to set colspan value dynamically?

Thanks.

Avatar
Ignorer
Meilleure réponse

Try this

<td align="center" style="border:1px solid black;"  t-att-colspan="partial_value" />" ><b><t t-raw="partial" /></b></td>

Avatar
Ignorer
Auteur

@Sajin Aziz: Thank you very much, it worked!!!

Thank you very much Sajin Aziz, it help me in rowspan.

Publications associées Réponses Vues Activité
1
juil. 25
1618
1
mai 25
1569
1
avr. 25
2207
1
févr. 25
1498
0
oct. 24
1256