Fix portal invoice link to use PDF download instead of desk URL

/Sales Invoice/NAME goes to desk (permission error for portal users).
Changed to PDF download API which respects portal user permissions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-05-04 20:49:37 -05:00
parent 19be48231d
commit 42a81f2868

View file

@ -190,7 +190,7 @@
<div class="pw-invoices-title">Invoices</div>
{% for inv in order.invoices %}
<div class="pw-invoice-row">
<a href="/Sales Invoice/{{ inv.name }}" style="color:var(--pw-blue);text-decoration:underline;">{{ inv.name }}</a>
<a href="/api/method/frappe.utils.print_format.download_pdf?doctype=Sales+Invoice&name={{ inv.name }}&no_letterhead=0" target="_blank" style="color:var(--pw-blue);text-decoration:underline;">{{ inv.name }}</a>
<span>
${{ "{:,.2f}".format(inv.grand_total | float) }} —
{% if inv.outstanding_amount == 0 %}