<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <data>

        <!-- Template invoice -->
        <template
            id="scop_report_invoice_adhesion"
            inherit_id="account.report_invoice_document"
        >
            <xpath expr="//t[@t-set='o']" position="after">
                <t t-if="o.journal_id == o.company_id.journal_adhesion_id">
                    <t t-set="is_adh" t-value="True" />
                </t>
                <t t-else="">
                    <t t-set="is_adh" t-value="False" />
                </t>
            </xpath>
            <xpath expr="//div[hasclass('page')]/h2" position="attributes">
                <attribute name="t-if">not is_adh</attribute>
            </xpath>
            <xpath expr="//div[hasclass('page')]/h2" position="after">
                <h2 t-if="is_adh">
                    <span
                        t-if="o.move_type == 'out_invoice' and o.state in ('open', 'in_payment', 'paid')"
                    >Droits d'adhésion</span>
                    <span
                        t-if="o.move_type == 'out_invoice' and o.state == 'draft'"
                    >Brouillon adhésion</span>
                    <span
                        t-if="o.move_type == 'out_invoice' and o.state == 'cancel'"
                    >Annulation adhésion</span>
                    <span t-field="o.name" />
                </h2>
            </xpath>

        </template>

    </data>
</odoo>