The tax_totals_json, is a field formatted in JSON as below
{
"amount_total": 4563.45,
"amount_untaxed": 4342.2,
"formatted_amount_total": "4,563.45 \u20ac",
"formatted_amount_untaxed": "4,342.20 \u20ac",
"groups_by_subtotal":
{
"Untaxed Amount": [
{
"tax_group_name": "Tax 15%",
"tax_group_amount": 221.25,
"tax_group_base_amount": 1475.0,
"formatted_tax_group_amount": "221.25 \u20ac",
"formatted_tax_group_base_amount": "1,475.00 \u20ac",
"tax_group_id": 2,
"group_key": "Untaxed Amount-2"}
]
},
"subtotals":
[
{
"name": "Untaxed Amount", "amount": 4342.2,
"formatted_amount": "4,342.20 \u20ac"
}
],
"allow_tax_edition": false}
So for example if you would like to access to the Taxes value, your code will be as below:
<t t-set="tax_totals" t-value="json.loads(doc.tax_totals_json)"/>
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>
<t t-foreach="tax_totals['groups_by_subtotal'][subtotal_to_show]" t-as="amount_by_group">
<t t-if="len(tax_totals['groups_by_subtotal'][subtotal_to_show]) > 1">
<span class="text-right" t-esc="amount_by_group['formatted_tax_group_amount']"/>
</t>
<t t-else="">
<span class="text-right" t-esc="amount_by_group['formatted_tax_group_amount']" />
</t>
</t>
</t>