fix(Rename Tool): use "Link" field instead of "Select" (backport #50995) (#51138)

fix(Rename Tool): use "Link" field instead of "Select"

(cherry picked from commit ba9bbed038)

# Conflicts:
#	erpnext/utilities/doctype/rename_tool/rename_tool.json
#	erpnext/utilities/doctype/rename_tool/rename_tool.py

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
ruthra kumar
2025-12-16 20:40:10 +05:30
committed by GitHub
3 changed files with 23 additions and 47 deletions

View File

@@ -2,14 +2,6 @@
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on("Rename Tool", {
onload: function (frm) {
return frappe.call({
method: "erpnext.utilities.doctype.rename_tool.rename_tool.get_doctypes",
callback: function (r) {
frm.set_df_property("select_doctype", "options", r.message);
},
});
},
refresh: function (frm) {
frm.disable_save();

View File

@@ -8,27 +8,13 @@
"doctype": "DocType",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Type of document to rename.",
"fieldname": "select_doctype",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Select DocType",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
"description": "Type of document to rename.",
"fieldname": "select_doctype",
"fieldtype": "Link",
"label": "Select DocType",
"link_filters": "[[\"DocType\",\"allow_rename\",\"=\",1],[\"DocType\",\"module\",\"!=\",\"Core\"]]",
"options": "DocType"
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -72,22 +58,18 @@
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 1,
"icon": "fa fa-magic",
"idx": 1,
"in_create": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"max_attachments": 1,
"modified": "2015-10-19 03:04:49.097140",
"modified_by": "Administrator",
"module": "Utilities",
"name": "Rename Tool",
"owner": "Administrator",
],
"hide_toolbar": 1,
"icon": "fa fa-magic",
"idx": 1,
"issingle": 1,
"links": [],
"max_attachments": 1,
"modified": "2025-12-09 14:18:33.838623",
"modified_by": "Administrator",
"module": "Utilities",
"name": "Rename Tool",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
@@ -112,4 +94,4 @@
],
"read_only": 0,
"read_only_onload": 0
}
}

View File

@@ -7,6 +7,7 @@
import frappe
from frappe.model.document import Document
from frappe.model.rename_doc import bulk_rename
from frappe.utils.deprecations import deprecated
class RenameTool(Document):
@@ -19,13 +20,14 @@ class RenameTool(Document):
from frappe.types import DF
file_to_rename: DF.Attach | None
select_doctype: DF.Literal
select_doctype: DF.Link | None
# end: auto-generated types
pass
@frappe.whitelist()
@deprecated
def get_doctypes():
return frappe.db.sql_list(
"""select name from tabDocType