Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
3953 Переглядів

i have a loop on dict doc 

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


Аватар
Відмінити

<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.

Найкраща відповідь

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

This might work.

Аватар
Відмінити
Найкраща відповідь
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>
Аватар
Відмінити
Автор

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.

Related Posts Відповіді Переглядів Дія
0
жовт. 20
3245
4
жовт. 19
4045
2
лют. 22
8429
0
серп. 20
3880
1
жовт. 22
3868