client creation bug fixes
This commit is contained in:
parent
cb33d0c3b3
commit
2ea20a86e3
7 changed files with 52 additions and 19 deletions
|
|
@ -299,7 +299,6 @@ def upsert_client(data):
|
|||
"link_name": customer_doc.name
|
||||
}
|
||||
address_doc.append("links", link)
|
||||
address_doc.save(ignore_permissions=True)
|
||||
contact_exists = frappe.db.exists("Contact", {"email_id": data.get("contact_email")})
|
||||
if not contact_exists:
|
||||
contact_doc = frappe.get_doc({
|
||||
|
|
@ -318,7 +317,8 @@ def upsert_client(data):
|
|||
else:
|
||||
contact_doc = frappe.get_doc("Contact", {"email_id": data.get("contact_email")})
|
||||
print("Contact already exists:", contact_doc.as_dict())
|
||||
|
||||
address_doc.custom_contact = contact_doc.name
|
||||
address_doc.save(ignore_permissions=True)
|
||||
return build_success_response({
|
||||
"customer": customer_doc.as_dict(),
|
||||
"address": address_doc.as_dict(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue