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

-  I want to skip the current iteration of the loop with continue in XML foreach ?

Imagine profil
Abandonează
Cel mai bun răspuns

Mostafa,

I don't think there is way to skip the loop, alternatively what u can do is, keep "if condition" to do your operation if particular condition matches, for eg:

to print div if your boolean value is true and skip if false, you can use:

<t t-foreach="<list_of_obj>" t-as="obj">

     <t t-if="obj.<bool_field>" ><!-- checking if field is True *-->

         <div>  Created when field is True</div>

     </t>

     <!-- No div will be created in 'false' case -->

</t>


Hope it helps!!

Imagine profil
Abandonează
Autor

Dear Pawan.

I find a way out by setting flags using t-set tag and t-value

Thank you for your support !

Related Posts Răspunsuri Vizualizări Activitate
2
aug. 23
12843
1
mar. 25
1285
0
nov. 24
1480
0
iun. 24
1549
1
iun. 24
2057