fix: Set Price List in case of User Permissions (#18968)

- Pick Price List if there is one User Permission record
This commit is contained in:
Faris Ansari
2019-09-09 14:28:12 +05:30
committed by Nabin Hait
parent ad2365502f
commit 6efe4acb1d

View File

@@ -155,7 +155,7 @@ def set_price_list(out, party, party_type, given_price_list, pos=None):
# price list
price_list = get_permitted_documents('Price List')
if price_list:
if price_list and len(price_list) == 1:
price_list = price_list[0]
elif pos and party_type == 'Customer':
customer_price_list = frappe.get_value('Customer', party.name, 'default_price_list')
@@ -588,4 +588,4 @@ def get_partywise_advanced_payment_amount(party_type, posting_date = None):
.format(("credit") if party_type == "Customer" else "debit", cond) , party_type)
if data:
return frappe._dict(data)
return frappe._dict(data)