fix(erpsetup): restore the letter head source, ignore <tbody> from UI saves #68

Merged
sharang merged 1 commits from fix/erpsetup-letterhead-source into main 2026-10-13 09:23:41 +00:00
Owner

What

  • The letter head step also compares source and footer_source (want: HTML/HTML).
  • ensureFields treats <tbody>/</tbody> as equal (Frappe's HTML editor adds them on a UI save).

Why

Live ERPNext letter head BreakPilot (last saved 2026-10-06 09:19 in the UI): source = Image, so documents use an image header instead of our HTML one, plus <tbody> in content and footer. The dry run showed letter head → would update on every run, and an apply would not have restored source.

Test plan

  • New test: tbody-only difference → exists; source Image → restored to HTML.
  • Existing erpsetup tests.
  • User: dry run shows letter head → would update once, apply, then exists; check one invoice PDF shows the HTML header.

Risk

Blast radius: Letter Head BreakPilot only (source fields). Rollback: set source back in the UI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB

## What - The letter head step also compares `source` and `footer_source` (want: HTML/HTML). - `ensureFields` treats `<tbody>`/`</tbody>` as equal (Frappe's HTML editor adds them on a UI save). ## Why Live ERPNext letter head `BreakPilot` (last saved 2026-10-06 09:19 in the UI): `source = Image`, so documents use an image header instead of our HTML one, plus `<tbody>` in content and footer. The dry run showed `letter head → would update` on every run, and an apply would not have restored `source`. ## Test plan - [x] New test: tbody-only difference → `exists`; source Image → restored to HTML. - [x] Existing erpsetup tests. - [ ] User: dry run shows `letter head → would update` once, apply, then `exists`; check one invoice PDF shows the HTML header. ## Risk **Blast radius:** Letter Head `BreakPilot` only (source fields). **Rollback:** set source back in the UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang added 1 commit 2026-10-13 09:07:52 +00:00
fix(erpsetup): restore the letter head source, ignore <tbody> from UI saves
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 25m56s
ci / image (pull_request) Skipped
c0a7db4e56
The live letter head had source "Image" (saved in the UI on 2026-10-06), so
documents printed an image header instead of the HTML one. erpsetup compared
only content and footer and would never have put it back; it now also
compares source and footer_source.

The same UI save wrapped the table rows in <tbody>, which made content and
footer look changed on every run. Field comparison now ignores <tbody>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang merged commit 271c23e5f2 into main 2026-10-13 09:23:41 +00:00
sharang deleted branch fix/erpsetup-letterhead-source 2026-10-13 09:23:41 +00:00
Sign in to join this conversation.