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

This commit is contained in:
Raffael Meyer
2025-12-16 13:24:50 +01:00
committed by GitHub
parent 273ff33ebf
commit ba9bbed038
3 changed files with 8 additions and 12 deletions

View File

@@ -2,14 +2,6 @@
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
frappe.ui.form.on("Rename Tool", { 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) { refresh: function (frm) {
frm.disable_save(); frm.disable_save();

View File

@@ -12,8 +12,10 @@
{ {
"description": "Type of document to rename.", "description": "Type of document to rename.",
"fieldname": "select_doctype", "fieldname": "select_doctype",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Select DocType" "label": "Select DocType",
"link_filters": "[[\"DocType\",\"allow_rename\",\"=\",1],[\"DocType\",\"module\",\"!=\",\"Core\"]]",
"options": "DocType"
}, },
{ {
"description": "Attach a comma separated .csv file with two columns, one for the old name and one for the new name.", "description": "Attach a comma separated .csv file with two columns, one for the old name and one for the new name.",
@@ -33,7 +35,7 @@
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"max_attachments": 1, "max_attachments": 1,
"modified": "2025-10-07 10:24:36.632780", "modified": "2025-12-09 14:18:33.838623",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Utilities", "module": "Utilities",
"name": "Rename Tool", "name": "Rename Tool",

View File

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