Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to skip the current iteration of foreach in XML odoo 8 ?

By
Mostafa Abd El Fattah
on 8/23/16, 8:10 AM 146 views

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

3

Pawan

--Pawan--
1267
| 4 3 5
Hyderabad, India
--Pawan--


Pawan
On 8/23/16, 9:59 AM

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!!

Dear Pawan.

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

Thank you for your support !

Mostafa Abd El Fattah
on 8/23/16, 2:09 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/23/16, 8:10 AM
Seen: 146 times
Last updated: 8/23/16, 9:59 AM