Field not permitted in query: letter_head_for — CRM bug under Python 3.14 blocks all printing

Problem

After updating to the latest versions, all PDF printing is broken
site-wide. Every print attempt on every voucher (Sales Order, Sales Invoice,
Payment Entry, etc.) fails with:

Field not permitted in query: letter_head_for

Root Cause

This is caused by a CRM migration patch failing under Python 3.14, which
prevents bench migrate from completing. Because migrate aborts early, the
tabLetter Head table never receives the new letter_head_for column
introduced in Frappe 16.24.0 (PR #38417 — Standard Letter Heads feature).
The Frappe ORM then rejects any query touching tabLetter Head as the DB
schema and DocType meta are out of sync.

The failing patch is:
crm.patches.v1_0.add_forecasting_section_in_quick_entry

Migrate Traceback

Executing crm.patches.v1_0.add_forecasting_section_in_quick_entry
File “…/crm/patches/v1_0/add_forecasting_section_in_quick_entry.py”, line 9, in execute

settings.add_forecasting_section(“Quick Entry”)

File “…/crm/fcrm/doctype/fcrm_settings/fcrm_settings.py”, line 130, in add_forecasting_section

field

TypeError: cannot use ‘dict’ as a set element (unhashable type: ‘dict’)

The add_forecasting_section method attempts a set operation on a list of
dicts. Python 3.14 does not allow dicts as set elements (unhashable type),
causing the crash.

Installed Versions

  • frappe: 16.24.0
  • erpnext: 16.25.0
  • india_compliance: 16.6.2
  • crm: 1.74.1
  • Python: 3.14
  • Hosting: Frappe Cloud

Workarounds

If you have SSH access:

bench --site <sitename> migrate --skip-failing

If you have SSH/DB access, manually insert into __PatchLog:

INSERT INTO `__PatchLog` (name, patched_on)
VALUES ('crm.patches.v1_0.add_forecasting_section_in_quick_entry', NOW());

Then re-run migrate.

If you are on Frappe Cloud without SSH (like us), neither the Query
Console nor the System Console permits write operations, so there is currently
no self-service workaround. You must raise a support ticket or wait for a
fixed CRM release.

GitHub Issue

Filed on the CRM repo: Migration patch fails under Python 3.14: TypeError in add_forecasting_section_in_quick_entry · Issue #2357 · frappe/crm · GitHub

Has anyone else hit this? Any workaround for Frappe Cloud users?

Update: v1.75.0 was released today but does not fix this issue —
the broken patch is unchanged. Proposed fix posted on the GitHub
issue: Migration patch fails under Python 3.14: TypeError in add_forecasting_section_in_quick_entry · Issue #2357 · frappe/crm · GitHub