1
<tbody>
<tr t-foreach="o.line_ids.filtered(lambda line: line.appears_on_payslip)" t-as="line">
<t t-if="line.code in ('BASIC','OT','DED','GROSS','NET')">
<td><span t-field="line.code"/></td>
<td><span t-field="line.name"/></td>
<td><span t-field="line.quantity"/></td>
<td><span t-field="line.amount" t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/></td>
<td><span t-field="line.total" t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/></td>
</t>
</tr>
</tbody>
上述代码是qweb报告中表的主体。而不是“line.quantity”,我想调用一个python函数“o.compute_overtime()”和写:Odoo - 从qweb报告中调用python函数
<t t-if="line.code=='OT'">
<td><span t-esc="i['ot_total']"/></td>
</t>
我怎么能调用的只有1场的功能?