diff --git a/frappe/core/doctype/file/file.py b/frappe/core/doctype/file/file.py index 944b0891c3..facaa8a03c 100644 --- a/frappe/core/doctype/file/file.py +++ b/frappe/core/doctype/file/file.py @@ -183,12 +183,10 @@ def move_file(file_list, new_parent, old_parent): frappe.get_doc("File", old_parent).save() frappe.get_doc("File", new_parent).save() - return "File(s) has been moved successfully!!" - def setup_folder_path(filename, new_parent): file = frappe.get_doc("File", filename) file.folder = new_parent file.save() if file.is_folder: - frappe.rename_doc("File", file.name, file.get_name_based_on_parent_folder()) + frappe.rename_doc("File", file.name, file.get_name_based_on_parent_folder(), ignore_permissions=True) diff --git a/frappe/model/rename_doc.py b/frappe/model/rename_doc.py index a25be9e39f..709c434dac 100644 --- a/frappe/model/rename_doc.py +++ b/frappe/model/rename_doc.py @@ -97,7 +97,7 @@ def validate_rename(doctype, new, meta, merge, force, ignore_permissions): if not (ignore_permissions or frappe.has_permission(doctype, "write")): frappe.msgprint(_("You need write permission to rename"), raise_exception=1) - if not force and not meta.allow_rename: + if not (force or ignore_permissions) and not meta.allow_rename: frappe.msgprint(_("{0} not allowed to be renamed").format(_(doctype)), raise_exception=1) # validate naming like it's done in doc.py