fix: Honor Shopping Cart Price List (#18884)

This commit is contained in:
Faris Ansari
2019-09-05 12:19:35 +05:30
committed by Nabin Hait
parent aea67c9843
commit 67aa7b8735

View File

@@ -287,19 +287,20 @@ def set_price_list_and_rate(quotation, cart_settings):
def _set_price_list(quotation, cart_settings): def _set_price_list(quotation, cart_settings):
"""Set price list based on customer or shopping cart default""" """Set price list based on customer or shopping cart default"""
if quotation.selling_price_list: from erpnext.accounts.party import get_default_price_list
return
# check if customer price list exists # check if customer price list exists
selling_price_list = None selling_price_list = None
if quotation.party_name: if quotation.party_name:
from erpnext.accounts.party import get_default_price_list selling_price_list = frappe.db.get_value('Customer', quotation.party_name, 'default_price_list')
selling_price_list = get_default_price_list(frappe.get_doc("Customer", quotation.party_name))
# else check for territory based price list # else check for territory based price list
if not selling_price_list: if not selling_price_list:
selling_price_list = cart_settings.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 quotation.selling_price_list = selling_price_list
def set_taxes(quotation, cart_settings): def set_taxes(quotation, cart_settings):