mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 05:39:12 +00:00
Add fix to support changes in user permission (#13923)
https://github.com/frappe/frappe/pull/5494
This commit is contained in:
@@ -130,15 +130,15 @@ def get_default_price_list(party):
|
||||
|
||||
def set_price_list(out, party, party_type, given_price_list):
|
||||
# price list
|
||||
price_list = filter(None, get_user_permissions().get("Price List", []))
|
||||
if isinstance(price_list, list):
|
||||
price_list = price_list[0] if len(price_list)==1 else None
|
||||
price_list = filter(None, get_user_permissions()
|
||||
.get("Price List", {})
|
||||
.get("docs", []))
|
||||
price_list = list(price_list)
|
||||
|
||||
if not price_list:
|
||||
price_list = get_default_price_list(party)
|
||||
|
||||
if not price_list:
|
||||
price_list = given_price_list
|
||||
if price_list:
|
||||
price_list = price_list[0]
|
||||
else:
|
||||
price_list = get_default_price_list(party) or given_price_list
|
||||
|
||||
if price_list:
|
||||
out.price_list_currency = frappe.db.get_value("Price List", price_list, "currency")
|
||||
|
||||
@@ -87,7 +87,9 @@ def validate_filters(filters):
|
||||
def get_warehouse_list(filters):
|
||||
from frappe.defaults import get_user_permissions
|
||||
condition = ''
|
||||
user_permitted_warehouse = filter(None, get_user_permissions().get("Warehouse", []))
|
||||
user_permitted_warehouse = filter(None, get_user_permissions()
|
||||
.get("Warehouse", {})
|
||||
.get("docs", []))
|
||||
value = ()
|
||||
if user_permitted_warehouse:
|
||||
condition = "and name in %s"
|
||||
|
||||
Reference in New Issue
Block a user