From a2db94761addee2826e476a9808880039e882d1a Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 5 Sep 2019 12:19:50 +0530 Subject: [PATCH] fix: Honor Shopping Cart Price List (#18885) --- erpnext/shopping_cart/cart.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index 0922f3d1a07..db2c3277d0f 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -336,19 +336,20 @@ def set_price_list_and_rate(quotation, cart_settings): def _set_price_list(quotation, cart_settings): """Set price list based on customer or shopping cart default""" - if quotation.selling_price_list: - return + from erpnext.accounts.party import get_default_price_list # check if customer price list exists selling_price_list = None if quotation.party_name: - from erpnext.accounts.party import get_default_price_list - selling_price_list = get_default_price_list(frappe.get_doc("Customer", quotation.party_name)) + selling_price_list = frappe.db.get_value('Customer', quotation.party_name, 'default_price_list') # else check for territory based price list if not selling_price_list: selling_price_list = cart_settings.price_list + if not selling_price_list and quotation.party_name: + selling_price_list = get_default_price_list(frappe.get_doc("Customer", quotation.party_name)) + quotation.selling_price_list = selling_price_list def set_taxes(quotation, cart_settings):