<?xml version="1.0"?>
<data inherit_id="portal.portal_layout">
        <xpath expr="//div[hasclass('o_portal_my_details')]" position="inside">
            <t t-set="partner" t-value="request.env.user.partner_id"/>
            <t t-set="providers_allowing_tokenization" t-value="request.env['payment.provider'].sudo()._get_compatible_providers(request.env.company.id, partner.id, 0., force_tokenization=True, is_validation=True)"/>
            <t t-set="existing_tokens" t-value="partner.payment_token_ids + partner.commercial_partner_id.sudo().payment_token_ids"/>
            <!-- Only show the link if a token can be created or if one already exists -->
            <div t-if="providers_allowing_tokenization or existing_tokens" class="manage_payment_method mt16">
                <a href="/my/payment_method">Manage payment methods</a>
            </div>
        </xpath>
    </data>

    