fix: duplicate entry error while renaming item (#9651)
Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
This commit is contained in:
parent
fbcd034710
commit
2233235ec2
1 changed files with 3 additions and 4 deletions
|
|
@ -16,16 +16,15 @@ def update_document_title(doctype, docname, title_field=None, old_title=None, ne
|
|||
"""
|
||||
Update title from header in form view
|
||||
"""
|
||||
if docname and new_name and not docname == new_name:
|
||||
docname = rename_doc(doctype=doctype, old=docname, new=new_name, merge=merge)
|
||||
|
||||
if old_title and new_title and not old_title == new_title:
|
||||
frappe.db.set_value(doctype, docname, title_field, new_title)
|
||||
frappe.msgprint(_('Saved'), alert=True, indicator='green')
|
||||
|
||||
if docname and new_name and not docname == new_name:
|
||||
return rename_doc(doctype=doctype, old=docname, new=new_name, merge=merge)
|
||||
|
||||
return docname
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def rename_doc(doctype, old, new, force=False, merge=False, ignore_permissions=False, ignore_if_exists=False, show_alert=True):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue