Aide

0

how to print value, key of dict item in xml ?

Avatar
tahirhan

Hi, i am trying to print key and value of dict item in for loop. I managed to print keys but, i don't know how to print values of them. My code :

<odoo>

        <data>

        <template id="index">

                <title>artin_review</title>

                <h1>Review Module</h1>

                <h2 class="lead">Reviews of Hotel</h2>

                <t t-foreach="summary" t-as="summary_part">

                        <p><t t-esc="summary_part"/></p>

                </t>


        </template>

        </data>

</odoo>

Avatar
Discard
1 Réponse
1
Avatar
Mitul Shingala
Best Answer

hello

for print the value you have to use keyword _value at the end of your variable.

like 

 <t t-foreach="summary" t-as="summary_part">

              <p><t t-esc="summary_part"/></p> <!-- print key -->

              <p><t t-esc="summary_part_value"/></p> <!-- print value -->

</t>

Avatar
Discard