fix: Prioritize Default Customer Price List in Portal
This commit is contained in:
parent
0233f94570
commit
fdddb679ed
@ -337,21 +337,17 @@ def set_price_list_and_rate(quotation, cart_settings):
|
|||||||
def _set_price_list(cart_settings, quotation=None):
|
def _set_price_list(cart_settings, quotation=None):
|
||||||
"""Set price list based on customer or shopping cart default"""
|
"""Set price list based on customer or shopping cart default"""
|
||||||
from erpnext.accounts.party import get_default_price_list
|
from erpnext.accounts.party import get_default_price_list
|
||||||
|
party_name = quotation.get("party_name") if quotation else get_party().get("name")
|
||||||
# check if customer price list exists
|
|
||||||
selling_price_list = None
|
selling_price_list = None
|
||||||
if quotation and quotation.get("party_name"):
|
|
||||||
selling_price_list = frappe.db.get_value('Customer', quotation.get("party_name"), 'default_price_list')
|
|
||||||
|
|
||||||
# else check for territory based price list
|
# check if default customer price list exists
|
||||||
|
if party_name:
|
||||||
|
selling_price_list = get_default_price_list(frappe.get_doc("Customer", party_name))
|
||||||
|
|
||||||
|
# check default price list in shopping cart
|
||||||
if not selling_price_list:
|
if not selling_price_list:
|
||||||
selling_price_list = cart_settings.price_list
|
selling_price_list = cart_settings.price_list
|
||||||
|
|
||||||
party_name = quotation.get("party_name") if quotation else get_party().get("name")
|
|
||||||
|
|
||||||
if not selling_price_list and party_name:
|
|
||||||
selling_price_list = get_default_price_list(frappe.get_doc("Customer", party_name))
|
|
||||||
|
|
||||||
if quotation:
|
if quotation:
|
||||||
quotation.selling_price_list = selling_price_list
|
quotation.selling_price_list = selling_price_list
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user