<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template id="report_saleorder_document" inherit_id="sale.report_saleorder_raw">
        <xpath expr='//t[@t-call="sale.report_saleorder_document"]' position="attributes">
            <attribute name="t-if" add="doc.company_id.country_code != 'BR'" separator="and"/>
        </xpath>
        <xpath expr='//t[@t-call="sale.report_saleorder_document"]' position="after">
            <t t-elif="doc.company_id.country_code == 'BR'"
                t-call="l10n_br_sales.report_saleorder_document_brazil" t-lang="doc.partner_id.lang"/>
        </xpath>
    </template>

    <template id="report_saleorder_document_brazil" inherit_id="sale.report_saleorder_document" primary="True">
        <t t-set="hide_taxes_details" position="attributes">
            <attribute name="t-value">True</attribute>
        </t>
        <xpath expr="//t[@t-call='sale.document_tax_totals']" position="replace">
            <t t-call="l10n_br_sales.document_tax_totals_brazil">
                <t t-set="tax_totals" t-value="doc.tax_totals"/>
                <t t-set="currency" t-value="doc.currency_id"/>
            </t>
        </xpath>
    </template>
</odoo>
