fix: On woocommerce test ping issued during a webhook creation
fix: On woocommerce test ping issued during a webhook creation
diff --git a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
index 6d977e0..b140df2 100644
--- a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
+++ b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
@@ -41,7 +41,10 @@
if frappe.flags.woocomm_test_order_data:
order = frappe.flags.woocomm_test_order_data
event = "created"
-
+ # Ignore the test ping issued during WooCommerce webhook configuration
+ # Ref: https://github.com/woocommerce/woocommerce/issues/15642
+ if frappe.request.data.decode('utf-8').startswith('webhook_id='):
+ return "success"
elif frappe.request and frappe.request.data:
verify_request()
try:
@@ -81,7 +84,9 @@
customer.save()
if customer_exists:
- frappe.rename_doc("Customer", old_name, customer_name)
+ # Fixes https://github.com/frappe/erpnext/issues/33708
+ if old_name != customer_name:
+ frappe.rename_doc("Customer", old_name, customer_name)
for address_type in (
"Billing",
"Shipping",