Sfoglia il codice sorgente

fix: duplicate entry error while renaming item (#9651)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
version-14
Suraj Shetty 5 anni fa
committed by GitHub
parent
commit
2233235ec2
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 3 aggiunte e 4 eliminazioni
  1. +3
    -4
      frappe/model/rename_doc.py

+ 3
- 4
frappe/model/rename_doc.py Vedi File

@@ -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):
"""


Caricamento…
Annulla
Salva