title: Odoo 10 : Exit Qweb loop
body: <p>I have a below code : </p>
  
  <pre><code>&lt;t t-foreach="doc.order_lines_layouted()" t-as="page"&gt;
       &lt;t t-foreach="page" t-as="layout_category"&gt;
           &lt;t t-foreach="layout_category['lines']" t-as="l"&gt;
                &lt;t t-if="l.product_id.product_tmpl_id.type == 'product'" &gt; 
  
                    &lt;br/&gt;&lt;br/&gt; &lt;br/&gt;&lt;br/&gt;
                    &lt;p&gt;Bill To: &lt;/p&gt;
                    &lt;!-- Adds customers contact details on top right corner --&gt;
                    &lt;div t-field="doc.partner_invoice_id" t-options="{&amp;quot;widget&amp;quot;: &amp;quot;contact&amp;quot;, &amp;quot;fields&amp;quot;: [&amp;quot;address&amp;quot;, &amp;quot;contactname&amp;quot;, &amp;quot;name&amp;quot;,  &amp;quot;phone&amp;quot;, &amp;quot;email&amp;quot;, &amp;quot;fax&amp;quot;], &amp;quot;no_marker&amp;quot;: True, &amp;quot;phone_icons&amp;quot;: True, &amp;quot;email_icons&amp;quot;: True}"/&gt;
                    &lt;p&gt;Customer VAT#:&amp;#160; &lt;span t-field= "doc.partner_invoice_id.vat"/&gt; &lt;br/&gt;
                    Customer#:&amp;#160;&lt;span t-field= "doc.partner_id.id"/&gt;
                                  &lt;/p&gt;
  
                &lt;/t&gt;
           &lt;/t&gt;
       &lt;/t&gt;
  &lt;/t&gt; 
  </code></pre>
  
  <p>I want to exit the loops once the t-if condition is satisfied. How can i do this? is there anything like <strong>exit();</strong> exists in qweb?</p>
  
  <p><strong>Info:</strong> I know below solution but this is not an elegant solution : </p>
  
  <pre><code>&lt;t t-set="foo" t-value="False"/&gt;
  
      &lt;t t-foreach="[1, 2, 3, 4, 5, 6]" t-as="i"&gt;
  
          &lt;t t-if="foo == False"&gt;
  
               &lt;p&gt;&lt;t t-esc="i"/&gt;&lt;/p&gt;
  
               &lt;t t-if="i==3"&gt;
  
                   &lt;t t-set="foo" t-value="True"/&gt;
  
               &lt;/t&gt;
  
          &lt;/t&gt;
  
      &lt;/t&gt;
  </code></pre>