fix(erpsetup): logo as a private File, PDFs work again #55

Merged
sharang merged 1 commits from fix/erp-logo-private-file into main 2026-09-30 13:32:48 +00:00
Owner

ERPNext strips data: URLs when it saves the letter head; what was left was an <img> without src, and frappe PDF generation then failed with KeyError: src. Since the erpsetup run at 15:06 no PDFs can be generated.

The fix: the chevron is uploaded as a private File (/private/files/breakpilot-chevron.png) and referenced from the letter head; frappe inlines private images as base64 in the PDF (inline_private_images), so no network access is needed.

Checked on the live ERPNext with a temporary file (deleted again): the sample invoice renders with the logo.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB

ERPNext strips `data:` URLs when it saves the letter head; what was left was an `<img>` without `src`, and frappe PDF generation then failed with `KeyError: src`. **Since the erpsetup run at 15:06 no PDFs can be generated.** The fix: the chevron is uploaded as a private File (`/private/files/breakpilot-chevron.png`) and referenced from the letter head; frappe inlines private images as base64 in the PDF (`inline_private_images`), so no network access is needed. Checked on the live ERPNext with a temporary file (deleted again): the sample invoice renders with the logo. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang added 1 commit 2026-09-30 13:08:31 +00:00
fix(erpsetup): logo as a private File, PDFs work again
ci / shared (pull_request) Successful in 14s
ci / test (pull_request) Successful in 23m44s
ci / image (pull_request) Skipped
d2566d084e
ERPNext strips data: URLs when it saves HTML (the Letter Head's HTML
Editor field), which left an <img> without src in the letter head; frappe's
PDF step then fails with KeyError: 'src', so no PDF could be generated.
The chevron is now uploaded as a private File (/private/files/
breakpilot-chevron.png); frappe inlines private images as base64 when it
renders a PDF, so wkhtmltopdf needs no network access.

Checked on the live ERPNext: a sample invoice renders with the logo.
Templates must not contain data: URLs or inline SVG (test).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang merged commit 7e75fbafb3 into main 2026-09-30 13:32:48 +00:00
Sign in to join this conversation.