问题描述
这是从库存拣选模型中得出的。
我能够添加一条跨度线
<span t-esc="move_operation.mapped('picking_id').display_name"/>
我尝试过
<t t-esc="sum(l.price_total for l in move_operation.mapped('picking_id') " />
但是还没有成功。
解决方法
一种实现方式类似于在发票中完成: https://github.com/odoo/odoo/blob/d3a6afe51fc4b864368acbc40a86ac6974d328dd/addons/account/views/report_invoice.xml#L72
您初始化变量。
<t t-foreach="lines" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"/>
在每一行中,将值添加到变量中。
<span t-esc="current_subtotal"/>
然后打印它。
$filter