跳至內容
選單
此問題已被標幟
1 回覆
9226 瀏覽次數

Hi,

everytime when the condition is fulfilled I need to increment the "section_index" variable by 1.
in .py it would be just section_index +=1, any clue how to do it xml? Would be grateful.


    <t t-set="section_index" t-value="-1"/>


    <t t-foreach="doc.order_line" t-as="line">


        <t t-if="line.display_type == 'line_section'">


            <!-- section_index = section_index + 1 -->

            <t t-set="section_index" ________???__________ />

                <tr>

                    <td>

                        <strong><p t-field='line.name'/></strong> 

                        <p t-esc="', '.join(doc.group_list()[section_index])" style="padding-left: 15px;"/>

                    </td>

頭像
捨棄
最佳答案

Hi,

Try,


<t t-set="section_index" t-value="section_index + 1"/>


Thanks

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
4月 21
3183
2
4月 23
8486
2
10月 22
5632
0
2月 22
1837
2
12月 21
9082