コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
3952 ビュー

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.

関連投稿 返信 ビュー 活動
0
10月 20
3245
4
10月 19
4045
2
2月 22
8429
0
8月 20
3880
1
10月 22
3868