fix(crm): skip rows with no first-contact date in lead conversion time

Address review (#56105): when there's no matching communication, first_contact is
None and date_diff(invoice_date, None) treats None as today, giving a wrong
(negative) duration. Skip the entry instead, mirroring the communication_count guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mihir Kandoi
2026-06-18 21:04:33 +05:30
parent 5787951ed1
commit 1f4702bde7

View File

@@ -132,6 +132,8 @@ def get_communication_details(filters):
(d.contact_email),
)
first_contact = first_contact[0][0] if first_contact else None
if not first_contact:
continue
duration = flt(date_diff(invoice[0][0], first_contact))