diff --git a/frappe/model/rename_doc.py b/frappe/model/rename_doc.py index 7554755d2b..11821ffb19 100644 --- a/frappe/model/rename_doc.py +++ b/frappe/model/rename_doc.py @@ -368,13 +368,13 @@ def validate_rename( if old == new: frappe.throw(_("No changes made because old and new name are the same.").format(old, new)) - if merge and not exists: - frappe.throw(_("{0} {1} does not exist, select a new target to merge").format(doctype, new)) - if exists and exists != new: # for fixing case, accents exists = None + if merge and not exists: + frappe.throw(_("{0} {1} does not exist, select a new target to merge").format(doctype, new)) + if not merge and exists and not ignore_if_exists: frappe.throw(_("Another {0} with name {1} exists, select another name").format(doctype, new))