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
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

@@ -12,8 +12,10 @@
{
"description": "Type of document to rename.",
"fieldname": "select_doctype",
"fieldtype": "Select",
"label": "Select DocType"
"fieldtype": "Link",
"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.",
@@ -33,7 +35,7 @@
"issingle": 1,
"links": [],
"max_attachments": 1,
"modified": "2025-10-07 10:24:36.632780",
"modified": "2025-12-09 14:18:33.838623",
"modified_by": "Administrator",
"module": "Utilities",
"name": "Rename Tool",

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[None]
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