diff --git a/custom_ui/api/db.py b/custom_ui/api/db.py index cda2b9c..fd72f76 100644 --- a/custom_ui/api/db.py +++ b/custom_ui/api/db.py @@ -136,12 +136,11 @@ def get_clients_table_data(filters = {}, sorting = [], page=1, page_size=10): rows = [] for address in addresses: - print("DEBUG: Processing address:", address) links = address.links print("DEBUG: Address links:", links) customer_links = [link for link in links if link.link_doctype == "Customer"] if links else None print("DEBUG: Extracted customer links:", customer_links) - customer_name = customer_links[0].link_name if customer_links else address["custom_customer_to_bill"] + customer_name = address["custom_customer_to_bill"] if address.get("custom_customer_to_bill") else (customer_links[0].link_name if customer_links else "N/A") tableRow = {} tableRow["id"] = address["name"] tableRow["customer_name"] = customer_name