<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template id="sale_order_portal_content_inherit_website_sale_digital" name="Orders Downloads Followup" inherit_id="sale.sale_order_portal_content">
        <xpath expr="//section[@id='details']//td[@id='product_name']" position="inside">
            <t t-if="digital_attachments" t-set="attachments" t-value="digital_attachments.get(line.product_id.id)"/>
            <t t-if="attachments">
                <span class="dropdown">
                    <button class="btn btn-sm btn-secondary dropdown-toggle" type="button" id="dropdownMenu1" data-bs-toggle="dropdown">
                        Downloads
                    </button>
                    <div class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                        <t t-foreach="attachments" t-as="a">
                            <a role="menuitem" tabindex="-1" t-att-href="'/my/download?attachment_id=%i' % a['id']" class="dropdown-item"><t t-esc="a['name']"/></a>
                        </t>
                    </div>
                </span>
            </t>
        </xpath>
    </template>
</odoo>
