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

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
Ignorer
Auteur Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
0
mars 15
4141
0
avr. 25
1831
0
janv. 24
2037
2
févr. 24
15921
4
avr. 24
21114