I have this code that prints a summary of an inputted list. but currently it just lists all the items but in a simplified manner. See below table and code.
Store Type | Region | Branch | Job Position | Head count | Work Days | Work hours |
Supermarket | Bicol Region | 1 | Merchandiser | 1 | 26 | |
Supermarket | Bicol Region | 1 | Merchandiser | 1 | 26 | |
Supermarket | Eastern Visayas | 1 | Merchandiser | 1 | 26 | |
Supermarket | Eastern Visayas | 1 | Merchandiser | 1 | 26 | |
Total | 4 | 0 | 4 | 104 |
<?xml version="1.0"?>
<t
t-name="manpower_sales_customization.deployment_schedule_summary_report">
<t t-call="report.html_container">
<div class="page">
<style>
.border {
border:1px solid black;
border-collapse:collapse;
}
.padding {
padding-top:5px;
padding-bottom:5px;
padding-left:5px;
padding-right:5px;
font-size: 13;
}
</style>
<div class="text-center">
<h4>Deployment Summary</h4>
</div>
<table width="100%" class="border padding">
<tr class="text-center">
<th class="border padding text-center" width="20%">
<span>Store Type</span>
</th>
<th class="border padding text-center" width="30">
<span>Region</span>
</th>
<th class="border padding text-center" width="5%">
<span>Branch</span>
</th>
<th class="border padding text-center" width="20%">
<span>Job Position</span>
</th>
<th class="border padding text-center" width="5%">
<span>Head count</span>
</th>
<th class="border padding text-center" width="5%">
<span>Work days</span>
</th>
<th class="border padding text-center" width="15%">
<span>Work Hours</span>
</th>
</tr>
<t t-set="work_hrs" t-value="0"/>
<t t-foreach="get_data(docs)" t-as="line">
<t t-if="position !=
line.get('position_id')">
<tr>
<th colspan="7"
style="text-align: left;font-size: 12px;font-family: 'Ubuntu'"
class="border padding">
<span
t-esc="line.get('position_id')"/>
</th>
</tr>
</t>
<t t-set="position"
t-value="line.get('position_id')"/>
<tr>
<td class="border padding text-left">
<span t-esc="line.get('store_type_ids')"/>
</td>
<td class="border padding text-left">
<span t-esc="line.get('region_id')"/>
</td>
<td class="border padding text-right">
<span t-esc="formatLang(line.get('branch_total'), digits=2)
or '0.0'"/>
</td>
<td class="border padding text-left">
<span t-esc="line.get('position_id')"/>
</td>
<td class="border padding text-right">
<span t-esc="formatLang(line.get('no_count'), digits=2) or
'0.0'"/>
</td>
<td class="border padding text-right">
<span t-esc="formatLang(line.get('no_days'), digits=2) or
'0.0'"/>
</td>
<td class="border padding text-right">
<span t-esc="line.get('work_hrs')"/>
<span t-set="work_hrs" t-value="work_hrs +
line.get('work_hrs')"/>
</td>
</tr>
</t>
<tr class="border">
<td class="border padding text-right" width="20"
colspan="2">
<b>Total :</b>
</td>
<td class="border padding text-right" width="10%">
<b>
<span t-esc="formatLang(count_branch())"/>
</b>
</td>
<td class="border padding text-right" width="20%">
<span/>
</td>
<td class="border padding text-right" width="10%">
<b>
<span t-esc="formatLang(count_no())"/>
</b>
</td>
<td class="border padding text-right" width="10%">
<b>
<span t-esc="formatLang(count_no_days())"/>
</b>
</td>
<td class="border padding text-right" width="10%">
<b><span t-esc="formatLang(work_hrs, digits=2) or
'0.00'"/></b>
</td>
</tr>
</table>
</div>
</t>
What I wanted is a real summary and not a totaled list. Such as below. Appreciate the help.
Store type | Region | Branch | job Position | Head count | Work days | Work hours |
Supermarket | Bicol | 2 | Merchandiser | 2 | 52 | |
Supermarket | Eastern Visayas | 2 | Merchandiser | 2 | 52 | |
Total | 4 | 4 | 104 |
Hi Bautista,
This is not the way to add the code in the question , currently the code is not easily readable.
Tel : 632-515-2084
just edited the post