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 break from for loop in qweb?

By
Mohammed Khamis
on 3/9/15, 6:31 AM 1,417 views

I want to break the looping but I dont have any information about this .

please help me how can do it.

thank you so much

2

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
On 3/9/15, 8:59 AM

you can use this code in the place for you page break:

 <!-- Pagebreak -->
                        <t t-if="p_index &lt; p_size - 1">
                            <![CDATA[
                                </tbody>
                            </table>
                            <p style="page-break-before:always;"> </p>
                            <table class="table table-condensed">
                            ]]>

                       </t>

0
SonnyV
On 3/9/15, 7:58 AM

You haven't really provided us with a lot of info but the following might work?

<div>
    <t t-foreach="[1, 2, 3]" t-as="i">
        <t t-if="condition">
            <p><t t-esc="i"/></p>
        </t>
    </t>
</div>

you loop through elements, check for a condition, if the condition is not met it'll break out of the if and if you don't have any statements under the if statement it'll break out of the for loop for that iteration

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: 3/9/15, 6:31 AM
Seen: 1417 times
Last updated: 3/16/15, 8:10 AM