fix(product-listing): Check if customer exists (#24030)

- It might happen that perty_name might not always be Customer
(it might be Supplier as well)
This commit is contained in:
Suraj Shetty
2020-12-01 09:14:57 +05:30
committed by GitHub
parent ccf5dc66e2
commit ad57eef40c

View File

@@ -345,7 +345,7 @@ def _set_price_list(cart_settings, quotation=None):
selling_price_list = None
# check if default customer price list exists
if party_name:
if party_name and frappe.db.exists("Customer", party_name):
selling_price_list = get_default_price_list(frappe.get_doc("Customer", party_name))
# check default price list in shopping cart