Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
9241 Переглядів

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
3188
2
квіт. 23
8496
2
жовт. 22
5637
0
лют. 22
1847
2
груд. 21
9099