xml中的四则运算与时间爱格式

取值第一个  和最后一个
<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>
 
xml样式的垂直剧中 style="vertical-align:middle;"

<span t-esc="time.strftime('%m/%d/%Y',time.strptime(object.datetimefield,'%Y-%m-%d %H:%M:%S'))"/>


<tr>
<td style="word-wrap:break-word;width:30%;font-size:14px;">客户:<span t-field="o.partner_id"/></td>
<td class="herdtd" >日 期:<span t-field="o.date" t-field-options='{"format": "MDD"}'/></td>
<td class="herdtd">税 码:</td>
<td style="word-wrap:break-word;width:26%;font-size:14px;">订单编号:<span t-field="o.name"/></td>
</tr>





posted @ 2017-12-02 20:58  何双新  阅读(1147)  评论(0编辑  收藏  举报