mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +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):
|
def set_price_list(out, party, party_type, given_price_list):
|
||||||
# price list
|
# price list
|
||||||
price_list = filter(None, get_user_permissions().get("Price List", []))
|
price_list = filter(None, get_user_permissions()
|
||||||
if isinstance(price_list, list):
|
.get("Price List", {})
|
||||||
price_list = price_list[0] if len(price_list)==1 else None
|
.get("docs", []))
|
||||||
|
price_list = list(price_list)
|
||||||
|
|
||||||
if not price_list:
|
if price_list:
|
||||||
price_list = get_default_price_list(party)
|
price_list = price_list[0]
|
||||||
|
else:
|
||||||
if not price_list:
|
price_list = get_default_price_list(party) or given_price_list
|
||||||
price_list = given_price_list
|
|
||||||
|
|
||||||
if price_list:
|
if price_list:
|
||||||
out.price_list_currency = frappe.db.get_value("Price List", price_list, "currency")
|
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):
|
def get_warehouse_list(filters):
|
||||||
from frappe.defaults import get_user_permissions
|
from frappe.defaults import get_user_permissions
|
||||||
condition = ''
|
condition = ''
|
||||||
user_permitted_warehouse = filter(None, get_user_permissions().get("Warehouse", []))
|
user_permitted_warehouse = filter(None, get_user_permissions()
|
||||||
|
.get("Warehouse", {})
|
||||||
|
.get("docs", []))
|
||||||
value = ()
|
value = ()
|
||||||
if user_permitted_warehouse:
|
if user_permitted_warehouse:
|
||||||
condition = "and name in %s"
|
condition = "and name in %s"
|
||||||
|
|||||||
Reference in New Issue
Block a user