Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
9311 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 21
3223
t-att-href url get error แก้ไขแล้ว
2
เม.ย. 23
8540
2
ต.ค. 22
5658
0
ก.พ. 22
1877
2
ธ.ค. 21
9144