mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-16 07:58:38 +00:00
fix(crm): keep returning None from create_customer on a linking failure
Preserve the pre-existing contract: create_customer returned None when contact/address linking failed. The savepoint fix kept the Customer (good) but started returning its name in that case, so a CRM caller treating a non-None return as full success could skip its retry/error handling. Return None on a linking failure while still keeping the Customer. (greptile #56683) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -169,6 +169,9 @@ def create_customer(customer_data: dict | None = None):
|
||||
except Exception:
|
||||
frappe.db.rollback(save_point="crm_customer_links")
|
||||
frappe.log_error(frappe.get_traceback(), "Error while linking contacts/address to new Customer")
|
||||
# keep the Customer, but preserve the pre-existing contract of returning None on a linking failure
|
||||
# so CRM callers still see the failure signal
|
||||
return
|
||||
|
||||
return customer_name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user