Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
9229 Visualizações

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>

Avatar
Cancelar
Melhor resposta

Hi,

Try,


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


Thanks

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
abr. 21
3185
2
abr. 23
8487
2
out. 22
5632
0
fev. 22
1841
2
dez. 21
9087