Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
3950 Ansichten

i have a loop on dict doc 

<t t-if="doc[currency_id] != 'SDG'">
<t t-set="total1" t-value="total1+ doc['tuition']"/>
</t>


Avatar
Verwerfen

<t t-set="total1" t-value="0"/>

<t t-if="doc.currency_id.display_name != 'SDG'">

<t t-set="total1" t-value="total1+ doc['tuition']"/>

</t>

Please stop using user names as tags for your posts.

Beste Antwort

Try this : 
<t t-if="doc['currency_id'] !== 'SDG'">
    <t t-set="total1" t-value="total1+ doc['tuition']"/>
</t>

This might work.

Avatar
Verwerfen
Beste Antwort
You can do it as like you are doing in python.



<t t-if="doc['currency_id'] != 'SDG'">
<t t-set="total1" t-value="total1+ doc['tuition']"/>
</t>
Avatar
Verwerfen
Autor

it does not work , i get

Error to render compiling AST

KeyError: None

Template: 754

Path: /templates/t/t/div[2]/table/tbody/t[10]/tr/td[3]/t

Node: <t t-if="doc[currency_id] != 'SDG'">

<t t-set="total1" t-value="total1+ doc['tuition']"/>

</t>

Please add currency_id in single quotes.

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Okt. 20
3245
4
Okt. 19
4045
2
Feb. 22
8427
0
Aug. 20
3878
1
Okt. 22
3868