From 2ac06d8532239af6239508f9124ff2d214cfa393 Mon Sep 17 00:00:00 2001 From: rocketdebris Date: Mon, 1 Dec 2025 13:33:48 -0500 Subject: [PATCH] Further merge conflicts. --- custom_ui/api/db/clients.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/custom_ui/api/db/clients.py b/custom_ui/api/db/clients.py index bdab125..4d5416b 100644 --- a/custom_ui/api/db/clients.py +++ b/custom_ui/api/db/clients.py @@ -203,10 +203,6 @@ def get_clients_table_data(filters={}, sortings=[], page=1, page_size=10): def upsert_client(data): """Create or update a client (customer and address).""" try: -<<<<<<< HEAD -======= - ->>>>>>> 8f44d90 (Fixed an API error when searching for a non existent client name.) data = json.loads(data) # Handle customer creation/update @@ -221,7 +217,6 @@ def upsert_client(data): }).insert(ignore_permissions=True) else: customer_doc = frappe.get_doc("Customer", data.get("customer_name")) -<<<<<<< HEAD print("Customer:", customer_doc.as_dict()) # Handle address creation @@ -236,23 +231,7 @@ def upsert_client(data): print("Existing address check:", existing_address) if existing_address: frappe.throw(f"Address already exists for customer {data.get('customer_name')}.", frappe.ValidationError) -======= - print("Customer:", customer_doc.as_dict()) - - # Check for existing address - filters = { - "address_line1": data.get("address_line1"), - "city": data.get("city"), - "state": data.get("state"), - } - existing_address = frappe.db.exists("Address", filters) - print("Existing address check:", existing_address) - if existing_address: - frappe.throw(f"Address already exists for customer {data.get('customer_name')}.", frappe.ValidationError) - - # Create address ->>>>>>> 8f44d90 (Fixed an API error when searching for a non existent client name.) address_doc = frappe.get_doc({ "doctype": "Address", "address_title": data.get("address_title"), @@ -264,7 +243,6 @@ def upsert_client(data): "pincode": data.get("pincode"), "custom_customer_to_bill": customer_doc.name }).insert(ignore_permissions=True) -<<<<<<< HEAD print("Address:", address_doc.as_dict()) #Handle contact creation @@ -320,11 +298,6 @@ def upsert_client(data): # Address -> Customer print("#####DEBUG: Linking address to customer.") address_doc.append("links", { -======= - - # Link address to customer - link = { ->>>>>>> 8f44d90 (Fixed an API error when searching for a non existent client name.) "link_doctype": "Customer", "link_name": customer_doc.name })