Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3712 Weergaven

I have the following template:

<t t-name='test_template'>
     <t t-call="other_template"/>
</t>

And I have the following code:

alert(data['items'].length);
var html = $(this.qweb.render("test_template", {'data' : data}));
alert(data['items'].length);


The first alert is showing 30. The second one is showing 1.

Why is the template renderer changing the object reference passed as data?

This only happens when using sub-template calling.

Avatar
Annuleer
Auteur Beste antwoord

It was my own fault. The problem was in another template.

I had somethine like this:

<t t-if="items.length > 1">

And I the correct code is:

<t t-if="items.length &gt; 1">

">" is a special character in xml.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
mrt. 15
3852
0
apr. 25
1483
0
jan. 24
1683
2
feb. 24
15333
4
apr. 24
20550