mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-14 17:33:09 +00:00
[minor] fix for custom perms
This commit is contained in:
@@ -8,17 +8,19 @@ from frappe.utils import cstr
|
||||
from frappe import msgprint, throw, _
|
||||
|
||||
from frappe.model.document import Document
|
||||
from frappe.permissions import get_doctypes_with_read
|
||||
|
||||
class NamingSeriesNotSetError(frappe.ValidationError): pass
|
||||
|
||||
class NamingSeries(Document):
|
||||
def get_transactions(self, arg=None):
|
||||
doctypes = list(set(frappe.db.sql_list("""select parent
|
||||
from `tabDocField` df where fieldname='naming_series' and
|
||||
exists(select * from `tabDocPerm` dp, `tabRole` role where dp.role = role.name and dp.parent = df.parent and not role.disabled)""")
|
||||
from `tabDocField` df where fieldname='naming_series'""")
|
||||
+ frappe.db.sql_list("""select dt from `tabCustom Field`
|
||||
where fieldname='naming_series'""")))
|
||||
|
||||
doctypes = list(set(get_doctypes_with_read()) | set(doctypes))
|
||||
|
||||
prefixes = ""
|
||||
for d in doctypes:
|
||||
options = ""
|
||||
|
||||
Reference in New Issue
Block a user