Dear All,
I tried to customize a helpdesk support report from as below code in my Odoo 11CE:
<?xml version="1.0"?>
<t t-name="bi_website_support_ticket.support_ticket_template_view">
<t t-call="web.external_layout">
<div class="page">
<t t-foreach="docs" t-as="o">
<div class="row">
<div class="col-xs-12" style="margin-top: 10px; margin-bottom:10px;">
<h3 style="margin-top: 10px; font-weight: bold;">
<span t-field="o.sequence"/> -
<span t-field="o.name"/>
</h3>
</div>
<div class="col-xs-12">
<table style="margin-bottom:10px;" width="100%">
<thead>
<tr class="active">
<th style="font-weight: bold;">Customer :</th>
<th style="font-weight: bold;">Email :</th>
<th style="font-weight: bold;">Phone :</th>
</tr>
</thead>
<tbody>
<tr>
<td t-if="o.partner_id" style="width: 40%;">
<span t-field="o.partner_id.name"/>
</td>
<td style="width: 30%;">
<span t-field="o.partner_id.email"/>
</td>
<td style="width: 30%;">
<span t-field="o.partner_id.phone"/>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-12">
<table style="margin-bottom:10px;" width="100%">
<thead>
<tr class="active">
<th style="font-weight: bold;">Project :</th>
<th style="font-weight: bold;">Category :</th>
<th style="font-weight: bold;">Priority :</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 40%;">
<span t-field="o.project_id.name"/>
</td>
<td style="width: 30%;">
<span t-field="o.category.name"/>
</td>
<td style="width: 30%;">
<span t-field="o.priority"/>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-12">
<table style="margin-bottom:10px;" width="100%">
<thead>
<tr class="active">
<th style="font-weight: bold;">Support Team :</th>
<th style="font-weight: bold;">Responsible :</th>
<th style="font-weight: bold;">Create Date :</th>
<th style="font-weight: bold;">Close Date :</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 25%;">
<span t-field="o.support_team_id.team_id.name"/>
</td>
<td style="width: 25%;">
<span t-field="o.user_id"/>
</td>
<td style="width: 25%;">
<span t-field="o.date_create"/>
</td>
<td style="width: 25%;">
<span t-field="o.date_close"/>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-12" style="margin-top: 10px; margin-bottom:10px;">
<h3 style="margin-top: 10px; font-weight: bold;">
<span>Description</span>
</h3>
<span t-field="o.description"/>
</div>
<div class="col-xs-12" style="margin-top: 10px; margin-bottom:10px;">
<h3 style="margin-top: 10px; font-weight: bold;"><span>Timesheet</span></h3>
<table class="table table-condensed">
<thead>
<tr>
<th>Date</th>
<th>Employee</th>
<th>Project</th>
<th>Task</th>
<th>Time (Hours)</th>
</tr>
</thead>
<tbody class="project_tbody">
<t t-foreach="o.timesheet_ids" t-as="timesheet">
<tr>
<td>
<span t-field="timesheet.date"/>
</td>
<td>
<span t-field="timesheet.employee_id.name"/>
</td>
<td>
<span t-field="timesheet.project_id.name"/>
</td>
<td>
<span t-field="timesheet.task_id.name"/>
</td>
<td>
<span t-field="timesheet.unit_amount"/>
</td>
</tr>
</t>
<tr>
<td colspan="4" align="right"><b>Total Hours:</b></td>
<td><field name="timesheet.unit_amount" sum="Total"/></td>
</tr>
</tbody>
</table>
</div>
</div>
</t>
</div>
</t>
</t>
I try to sum the "timesheet.unit_amount", but it just failed.
Can anyone give me suggestion for how to sum it?