From 69d9f51dbbdffd54eecc605a1044d0868b5792b6 Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Mon, 12 Mar 2018 11:15:49 +0530 Subject: [PATCH] if price list not found, set default selling/ buying price list from settings (#13259) --- erpnext/accounts/party.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 5237a71949..a3a889b1d4 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -141,7 +141,10 @@ def set_price_list(out, party, party_type, given_price_list): price_list = get_default_price_list(party) if not price_list: - price_list = given_price_list + if party.doctype == "Customer": + price_list = frappe.db.get_single_value('Selling Settings', 'selling_price_list') + else: + price_list = frappe.db.get_single_value('Buying Settings', 'buying_price_list') if price_list: out.price_list_currency = frappe.db.get_value("Price List", price_list, "currency")