Merge branch 'develop' into currency-exchange-settings
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
@@ -9,7 +8,6 @@ from frappe.custom.doctype.custom_field.custom_field import create_custom_field
|
||||
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
|
||||
from frappe.installer import update_site_config
|
||||
from frappe.utils import cint
|
||||
from six import iteritems
|
||||
|
||||
from erpnext.accounts.doctype.cash_flow_mapper.default_cash_flow_mapper import DEFAULT_MAPPERS
|
||||
from erpnext.setup.default_energy_point_rules import get_default_energy_point_rules
|
||||
@@ -183,12 +181,12 @@ def add_non_standard_user_types():
|
||||
user_types = get_user_types_data()
|
||||
|
||||
user_type_limit = {}
|
||||
for user_type, data in iteritems(user_types):
|
||||
for user_type, data in user_types.items():
|
||||
user_type_limit.setdefault(frappe.scrub(user_type), 10)
|
||||
|
||||
update_site_config('user_type_doctype_limit', user_type_limit)
|
||||
|
||||
for user_type, data in iteritems(user_types):
|
||||
for user_type, data in user_types.items():
|
||||
create_custom_role(data)
|
||||
create_user_type(user_type, data)
|
||||
|
||||
@@ -238,7 +236,7 @@ def create_user_type(user_type, data):
|
||||
doc.save(ignore_permissions=True)
|
||||
|
||||
def create_role_permissions_for_doctype(doc, data):
|
||||
for doctype, perms in iteritems(data.get('doctypes')):
|
||||
for doctype, perms in data.get('doctypes').items():
|
||||
args = {'document_type': doctype}
|
||||
for perm in perms:
|
||||
args[perm] = 1
|
||||
|
||||
Reference in New Issue
Block a user