Hi,
To add the total number of quantities in the invoice report, Try below code
<template id="inherit_report_invoice_document"
inherit_id="account.report_invoice_document">
<xpath expr="//tbody[hasclass('invoice_tbody')]"
position="inside">
<t t-set="quantity_set" t-value="0.0"/>
</xpath>
<xpath expr="//td[@name='account_invoice_line_name']"
position="after">
<t t-set="quantity_set" t-value="quantity_set + line.quantity"/>
</xpath>
<xpath expr="//t[@t-foreach='lines']"
position="after">
<div>Total Quantity : <t t-out="quantity_set"/></div>
</xpath>
</template>
Add the above code in your custom module, and the output be like
Hope it helps