[link] add doctype option in customize

This commit is contained in:
Rushabh Mehta 2015-03-03 21:20:20 +05:30
parent d86eb386e5
commit c94033013d
3 changed files with 12 additions and 11 deletions

View file

@ -188,7 +188,13 @@ def get_data():
"type": "doctype",
"name": "Custom Script",
"description": _("Add custom javascript to forms.")
},
{
"type": "doctype",
"name": "DocType",
"description": _("Add custom forms.")
}
]
},
{

View file

@ -15,18 +15,11 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(!frappe.boot.developer_mode && !doc.custom) {
// make the document read-only
cur_frm.set_read_only();
// make help heading
msgprint(__('Cannot Edit {0} directly: To edit {0} properties, create / update {1}, {2} and {3}', [
'DocType',
'<a href="#List/Custom%20Field">'+ __('Custom Field')+'</a>',
'<a href="#List/Custom%20Script">'+ __('Custom Script')+'</a>',
'<a href="#List/Property%20Setter">'+ __('Property Setter')+'</a>',
]));
}
if(doc.__islocal && !frappe.boot.developer_mode) {
if(doc.__islocal && (user !== "Administrator" || !frappe.boot.developer_mode)) {
cur_frm.set_value("custom", 1);
cur_frm.toggle_enable("custom", 0);
}
}

View file

@ -337,7 +337,7 @@
"idx": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-02-20 05:09:34.709530",
"modified": "2015-03-03 10:40:45.768116",
"modified_by": "Administrator",
"module": "Core",
"name": "DocType",
@ -345,6 +345,7 @@
"permissions": [
{
"cancel": 0,
"create": 1,
"delete": 0,
"email": 1,
"permlevel": 0,
@ -352,7 +353,8 @@
"read": 1,
"report": 1,
"role": "System Manager",
"submit": 0
"submit": 0,
"write": 1
},
{
"cancel": 0,