diff --git a/templates/dashboard_detail.xml b/templates/dashboard_detail.xml index ba63bea49b2544f580a218b1469d5233f8a2cc86..46ef24eade833c23cbc6a41e16c0304a0600d295 100644 --- a/templates/dashboard_detail.xml +++ b/templates/dashboard_detail.xml @@ -125,17 +125,28 @@ <tr t-foreach="data" t-as="line"> <td t-out="line_index + 1" /> <t t-foreach="line.values()" t-as="v"> - <td t-att-class="'text-end' if isinstance(v, (int, float)) else ''"> - <t t-if="isinstance(v, (int, float))"> - <t t-out="v" t-options="{'widget': 'float', 'precision': 0}" /> - </t> - <t t-else=""> - <t t-out="v" /> - </t> + <td t-if="isinstance(v, (int, float))" class="text-end"> + <t t-out="v" t-options="{'widget': 'float', 'precision': 0}" /> + </td> + <td t-else=""> + <t t-out="v" /> </td> </t> </tr> </tbody> + <tfoot> + <tr class="bg-100"> + <th>Total</th> + <th t-foreach="data[-1].items()" t-as="footer" class="text-end"> + <t t-if="isinstance(footer[1], (int, float))"> + <t + t-out="sum(list(map(lambda d: d.get(footer[0]) if d.get(footer[0]) else 0.0, data)))" + t-options="{'widget': 'float', 'precision': 0}" + /> + </t> + </th> + </tr> + </tfoot> </table> </div> </template>