Like conditions, foreach applies to the element bearing the directive's attribute. <p t-foreach="[1, 2, 3]" t-as="i"> <t t-esc="i"/> <t t-esc="i_index"/># replace with that </p>