打印单循环打出一张单子所有数据

<tbody>
<t t-set="items" t-value="[0,1,2,3,4,5,6,7,8,9,10]" />
<t t-set="i" t-value="0" />
<tr t-foreach="o.order_line" t-as="l" class="gxtr">
<t t-set="i" t-value="i+1" />
<td height="25"><t t-esc="i"/></td>
<td><span t-field="l.product_id.product_coden"/></td>
<td ><span t-field="l.cust_product_id"/></td>
<td ><span t-field="l.product_id.cust_spec"/></td>
<td class="text-right">
<span t-field="l.product_qty"/><span t-field="l.product_uom"/>
</td>
<td></td>
<td >
<span t-field="l.price_unit"/>
</td>
<td>
<span t-field="l.date_planned"/>
</td>
<td></td>
<td><span t-field="l.memo"/></td>

<!--<t t-if="i>6" >-->
<!--<t t-set="i" t-value="0" />-->
<!--</t>-->
</tr>

<tr t-foreach="items" t-as="j" class="gxtr">
<t t-if="j>=(i%10)" >
<td height="22"></td>
<td ></td>
<td ></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td> </t> </tr></tbody>
原文地址:https://www.cnblogs.com/1314520xh/p/7150704.html