mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-11 05:31:48 +00:00
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:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user