check in meta if allow_rename is enabled

This commit is contained in:
Zlash65 2018-01-05 13:05:05 +05:30
parent abfbb0432c
commit d9472b4730

View file

@ -184,11 +184,7 @@ frappe.views.TreeView = Class.extend({
condition: function(node) {
let allow_rename = true;
if (me.doctype && frappe.get_meta(me.doctype)) {
let autoname = frappe.get_meta(me.doctype).autoname;
// only allow renaming if doctye is set and
// autoname property is "prompt"
allow_rename = autoname && autoname.toLowerCase()==='prompt';
if(!frappe.get_meta(me.doctype).allow_rename) allow_rename = false;
}
return !node.is_root && me.can_write && allow_rename;
},