Merge pull request #18385 from rohitwaghchaure/offline_pos_syncing_issue_for_customer_develop
fix: offline pos syncing issue for customer
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 3e013f5..e2f99d6 100755
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -451,6 +451,10 @@
def add_customer(data):
+ customer = data.get('full_name') or data.get('customer')
+ if frappe.db.exists("Customer", customer.strip()):
+ return customer.strip()
+
customer_doc = frappe.new_doc('Customer')
customer_doc.customer_name = data.get('full_name') or data.get('customer')
customer_doc.customer_pos_id = data.get('customer_pos_id')