Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
9238 Lượt xem

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>

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Try,


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


Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 21
3188
2
thg 4 23
8494
2
thg 10 22
5637
0
thg 2 22
1847
2
thg 12 21
9098