Merge pull request #7417 from scmmishra/disable-customize-hotfix

feat: disable customize option for single doctypes #7415
This commit is contained in:
Rushabh Mehta 2019-05-07 11:10:57 +05:30 committed by GitHub
commit ac975eea13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -89,6 +89,9 @@ class CustomizeForm(Document):
if self.doc_type in core_doctypes_list:
return frappe.msgprint(_("Core DocTypes cannot be customized."))
if meta.issingle:
return frappe.msgprint(_("Single DocTypes cannot be customized."))
if meta.custom:
return frappe.msgprint(_("Only standard DocTypes are allowed to be customized from Customize Form."))

View file

@ -167,7 +167,7 @@ frappe.ui.form.Toolbar = Class.extend({
me.frm.savetrash();}, true);
}
if(frappe.user_roles.includes("System Manager")) {
if(frappe.user_roles.includes("System Manager") && me.frm.meta.issingle === 0) {
this.page.add_menu_item(__("Customize"), function() {
frappe.set_route("Form", "Customize Form", {
doc_type: me.frm.doctype