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

Frontport of #18968
This commit is contained in:
Faris Ansari 2020-04-14 11:51:48 +05:30 committed by GitHub
parent 02c9332695
commit 64f01bddc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,7 +163,8 @@ def set_price_list(party_details, party, party_type, given_price_list, pos=None)
# price list # price list
price_list = get_permitted_documents('Price List') price_list = get_permitted_documents('Price List')
if price_list: # if there is only one permitted document based on user permissions, set it
if price_list and len(price_list) == 1:
price_list = price_list[0] price_list = price_list[0]
elif pos and party_type == 'Customer': elif pos and party_type == 'Customer':
customer_price_list = frappe.get_value('Customer', party.name, 'default_price_list') customer_price_list = frappe.get_value('Customer', party.name, 'default_price_list')