تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
9680 أدوات العرض

please I would like an example for looping in qweb 

I want to loop on purchase_order but i don't know how can i make it 

please help me for that

thank you so much

الصورة الرمزية
إهمال

Yenthe has a good example, you should however know that if you wish to update a variable from inside your loop you need to apply a recent patch: https://github.com/odoo/odoo/issues/4461

أفضل إجابة

Hi Mohammed

There is a sample inside the purchase report, you should do pretty much the same.Have a look at https://github.com/odoo/odoo/blob/8.0/addons/purchase/views/report_purchaseorder.xml

You can loop over data like this:

<table>

<tr t-foreach="o.order_line" t-as="line">

<td>

<span t-field="line.name"/>

</td>

<td>

<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/>

</td>

</tr>

</table>

الصورة الرمزية
إهمال

what about a simple tree view where you dont have one2many field?

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يوليو 19
14654
0
مارس 15
4609
2
مايو 22
33736
1
نوفمبر 20
2572
2
ديسمبر 19
11452