Community mailing list archives

community@mail.odoo.com

Re: variable is not reachable

by
khaled
- 09/29/2015 04:59:29
@Shivam Goyal

The variable is accessible as you mentioned.

----------------------

I got a solution using [ ] instead of using list() & everything worked fine

<t t-foreach="partners" t-as="partner">
    <t t-set="p_inovices" t-value=" [ l.number for l in docs if l.partner_id.name == 
partner ] " />
</t>

also I'd like to mention that if I didn't use list comprehension it does work fine :D, as following:


<t t-foreach="partners" t-as="partner">
    <t t-set="p_inovices" t-value="
list ( partner ) " />
</t>


I guess because qweb foreach is working a little bit different as mentioned there: https://github.com/odoo/odoo/issues/4461