[minor] fix for custom perms
This commit is contained in:
parent
d40e661ebd
commit
af077dc616
@ -374,7 +374,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Warehouse for reserving items",
|
||||
"description": "",
|
||||
"fieldname": "source_warehouse",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@ -383,7 +383,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Source Warehouse",
|
||||
"label": "Source Warehouse (for reserving Items)",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Warehouse",
|
||||
@ -1244,7 +1244,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-07 05:13:02.064821",
|
||||
"modified": "2017-01-12 05:32:52.523006",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Manufacturing",
|
||||
"name": "Production Order",
|
||||
@ -1298,5 +1298,6 @@
|
||||
"read_only_onload": 0,
|
||||
"sort_order": "ASC",
|
||||
"title_field": "production_item",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
@ -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 = ""
|
||||
|
Loading…
Reference in New Issue
Block a user