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場的功能?