mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
[fix] Removed customer, supplier and added link_name from website_list_for_contact file
This commit is contained in:
@@ -100,11 +100,12 @@ def post_process(doctype, data):
|
||||
|
||||
def get_customers_suppliers(doctype, user):
|
||||
meta = frappe.get_meta(doctype)
|
||||
contacts = frappe.get_all("Contact", fields=["customer", "supplier", "email_id"],
|
||||
filters={"email_id": user})
|
||||
contacts = frappe.db.sql(""" select `tabContact`.email_id, `tabDynamic Link`.link_doctype, `tabDynamic Link`.link_name
|
||||
from `tabContact`, `tabDynamic Link` where
|
||||
`tabContact`.name = `tabDynamic Link`.parent and `tabContact`.email_id =%s """, user, as_dict=1)
|
||||
|
||||
customers = [c.customer for c in contacts if c.customer] if meta.get_field("customer") else None
|
||||
suppliers = [c.supplier for c in contacts if c.supplier] if meta.get_field("supplier") else None
|
||||
customers = [c.link_name for c in contacts if c.link_doctype == 'Customer'] if meta.get_field("customer") else None
|
||||
suppliers = [c.link_name for c in contacts if c.link_doctype == 'Supplier'] if meta.get_field("supplier") else None
|
||||
|
||||
return customers, suppliers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user