Merge pull request #8663 from hrwX/rename-doc-fix
fix: Rename Document Fix
This commit is contained in:
commit
d3de54aaa1
1 changed files with 3 additions and 3 deletions
|
|
@ -12,15 +12,15 @@ from frappe.model.utils.user_settings import sync_user_settings, update_user_set
|
|||
|
||||
|
||||
@frappe.whitelist()
|
||||
def update_document_title(doctype, docname, title_field, old_title, new_title, old_name, new_name):
|
||||
def update_document_title(doctype, docname, title_field=None, old_title=None, new_title=None, old_name=None, new_name=None):
|
||||
"""
|
||||
Update title from header in form view
|
||||
"""
|
||||
if new_title and old_title != new_title:
|
||||
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 new_name and old_name != new_name:
|
||||
if old_name and new_name and not old_name == new_name:
|
||||
return rename_doc(doctype, old_name, new_name)
|
||||
|
||||
return old_name
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue