fix: sync shopify customer addresses (#25481)
diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py
index 7866fde..2af57f4 100644
--- a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py
+++ b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py
@@ -32,10 +32,12 @@
raise e
def create_customer_address(customer, shopify_customer):
- if not shopify_customer.get("addresses"):
- return
+ addresses = shopify_customer.get("addresses", [])
- for i, address in enumerate(shopify_customer.get("addresses")):
+ if not addresses and "default_address" in shopify_customer:
+ addresses.append(shopify_customer["default_address"])
+
+ for i, address in enumerate(addresses):
address_title, address_type = get_address_title_and_type(customer.customer_name, i)
try :
frappe.get_doc({