Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
9188 Vizualizări

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>

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

Try,


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


Thanks

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
apr. 21
3156
2
apr. 23
8462
2
oct. 22
5601
0
feb. 22
1830
2
dec. 21
9065