Skip to content

Commit

Permalink
Merge pull request #358 from frappe/develop
Browse files Browse the repository at this point in the history
chore: Merge develop to main
  • Loading branch information
shariquerik authored Sep 19, 2024
2 parents c16fa11 + ac0eae4 commit 425f5eb
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,20 @@ def get_contacts(doc):
return contacts

def get_organization_address(organization):
address = frappe.get_value("CRM Organization", organization, "address")
address = frappe.db.get_value("CRM Organization", organization, "address")
address = frappe.get_doc("Address", address) if address else None
return address
return {
"name": address.name,
"address_title": address.address_title,
"address_type": address.address_type,
"address_line1": address.address_line1,
"address_line2": address.address_line2,
"city": address.city,
"county": address.county,
"state": address.state,
"country": address.country,
"pincode": address.pincode,
}

def create_customer_in_erpnext(doc, method):
erpnext_crm_settings = frappe.get_single("ERPNext CRM Settings")
Expand All @@ -200,7 +211,7 @@ def create_customer_in_erpnext(doc, method):
"website": doc.website,
"crm_deal": doc.name,
"contacts": json.dumps(contacts),
"address": address.as_dict() if address else None,
"address": json.dumps(address) if address else None,
}
if not erpnext_crm_settings.is_erpnext_in_different_site:
from erpnext.crm.frappe_crm_api import create_customer
Expand Down

0 comments on commit 425f5eb

Please sign in to comment.