Showing error Customer not found | Woocommerce error

New customers are not auto-created. Showing error Customer not found

Traceback (most recent call last):
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/connectors/”, line 25, in order
_order(*args, **kwargs)
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/connectors/”, line 56, in order
create_sales_order(order, woocommerce_settings, customer_name, sys_lang)
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/connectors/”, line 182, in create_sales_order
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/model/”, line 230, in insert
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/model/”, line 896, in run_before_save_methods
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/model/”, line 797, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/model/”, line 1073, in composer
return composed(self, method, *args, **kwargs)
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/model/”, line 1056, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/model/”, line 791, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/”, line 36, in validate
super(SalesOrder, self).validate()
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/controllers/”, line 39, in validate
super(SellingController, self).validate()
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/controllers/”, line 21, in validate
super(StockController, self).validate()
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/controllers/”, line 70, in validate
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/controllers/”, line 56, in set_missing_values
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/controllers/”, line 85, in set_missing_lead_customer_details
party_address=self.customer_address, shipping_address=self.shipping_address_name)
File “/home/aadhilpm/frappe-bench/apps/erpnext/erpnext/accounts/”, line 43, in get_party_details
if not ignore_permissions and not frappe.has_permission(party_type, “read”, party):
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/”, line 605, in has_permission
out = frappe.permissions.has_permission(doctype, ptype, doc=doc, verbose=verbose, user=user)
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/”, line 26, in inner
result = func(*args, **kwargs)
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/”, line 62, in has_permission
doc = frappe.get_doc(, doc)
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/”, line 753, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/model/”, line 71, in get_doc
return controller(*args, **kwargs)
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/model/”, line 106, in init
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/model/”, line 149, in load_from_db
(“{0} {1} not found”).format(
(self.doctype),, frappe.DoesNotExistError)
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/”, line 376, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/”, line 355, in msgprint
File “/home/aadhilpm/frappe-bench/apps/frappe/frappe/”, line 315, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: Customer AAdhil not found

any solution?

I get that same error, but when I set Customer Naming to “Customer Name” in the Selling Settings, it works perfectly.
However, if two customers with the same name order something in Woocommerce, the Sales Order always gets linked to the first customer created with that name, which is not acceptable, so some kind of customer number or naming series is a must.

Apparently the Woocommerce integration is not working when you set Customer Naming to “Naming Series”.
How can we create customer numbers in ERPNext for customers who bought something in Woocommerce? Does it have to be set in Woocommerce itself and then transferred?

When a purchase is made in Woocommerce the customer is generated an ID that is imported to ERPNext, if another person with the same name is registered in woocommerce is generated another ID. Another way would be to place an additional field as the ID # in woocommerce to be imported to ERPNExt.

Hi Leo,
thanks for your answer.
Somehow the woocommerce customer ID doesn’t make it into ERPNext in my case:

The data received by ERPNext shows 'customer_id': 0,
Is there a special setting needed in woocommerce to make it transmit the Customer ID?

Are you using the woocommerce integrated connector?

I have tried it with the native ERPNext integration as well as the Woocommerce connector by libracore.
Do you use guest orders with your shop or only allow registered users to order?

In woocommerce is enabled the 2 options, with registration and without registration; I’m going to make a test purchase as a guest…maybe I have the same error and I have not noticed. :sunglasses:

Hi Leo, could you tell me how your customers are being named?

1 Like

Hello, I have it set as: Customer Name.

Thank you very much Leo.
I have now solved this issue by not using the Webhook-based Woocommerce Integration but the custom app Woocommerce Connector which only uses the API.
With this I am able to use automatic naming as well and insert Woocommerce customer ID into the ERPNExt customer naming.

Excellent news that you were able to solve the issues, a query as you managed to insert the Woocommerce client ID in the client name ERPNExt.