取值第一个 和最后一个
<tr>
<td height="28" colspan="2" style="font-size:14px" scope="col"><div align="left">2.1、材料交期:<span t-field="o.line_id[0].date_planned"/> --- <span t-field="o.line_id[-1].date_planned"/> </div></td>
</tr>
<t t-set="q" t-value="q+l.price_unit*l.product_uom_qty"/>
<t t-set="items" t-value="[0]" />
<t t-set="i" t-value="0" />
<tr t-foreach="o.move_lines" t-as="l" bgcolor="#fff" class="gxtr">
<t t-set="t" t-value="0"/>
<t t-set="t" t-value="t+l.price_unit*l.product_uom_qty"/>
<t t-set="i" t-value="i+1" />
<td height="25"><t t-esc="i"/></td>
<td><span t-field="l.product_id.pname"/></td>
<td><span t-field="l.product_id.spec"/></td>
<!--<td><span t-field="l.product_id.material"/></td>-->
<td><span t-field="l.product_uom"/></td>
<td><div align="center"><span t-field="l.product_uom_qty"/></div></td>
<td><div align="center"><span t-field="l.price_unit"/></div></td>
<td><div align="center"><t t-esc="t"/></div></td>
<td><span t-field="l.meno"/></td>
<td><span t-field="l.khwl_code"/></td>
<t t-set="q" t-value="q+l.product_uom_qty"/>
<t t-set="p" t-value="p+t"/>
</tr>
原文:http://www.cnblogs.com/1314520xh/p/7955587.html