mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-23 20:16:40 +00:00
- Fix N+1: the per-lead conversion issued 4 queries per lead (Opportunity, Quotation, Issue, Communication). Collect the reference documents for all leads in 3 bulk queries, then one Communication query per lead -> ~N+3 round-trips instead of 4N, matching the original single-query-per-lead cost. - Constrain reference_doctype in the Communication lookup (names are unique only within a doctype), closing a latent cross-doctype name-collision gap the original also had. Both-engine test still green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>