[fix] filter can_import with can_create, fixes frappe/erpnext#6966

This commit is contained in:
Rushabh Mehta 2016-12-21 11:39:05 +05:30
parent 863f16050a
commit 1f8f1ef2dc

View file

@ -149,8 +149,8 @@ class UserPermissions:
self.can_read.remove(dt)
if "System Manager" in self.roles:
self.can_import = frappe.db.sql_list("""select name from `tabDocType`
where allow_import = 1""")
self.can_import = filter(lambda d: d in self.can_create, frappe.db.sql_list("""select name from `tabDocType`
where allow_import = 1"""))
def get_defaults(self):
import frappe.defaults