mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fix: Honor Shopping Cart Price List (#18884)
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user