fix: commit individual SLE rename for large datasets (#25085)

This commit is contained in:
Rohan
2021-03-31 15:23:04 +05:30
committed by GitHub
parent b904304268
commit 53a32fecdb

View File

@@ -294,4 +294,8 @@ def rename_temporarily_named_docs(doctype):
oldname = doc.name
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)
newname = doc.name
frappe.db.sql("""UPDATE `tab{}` SET name = %s, to_rename = 0 where name = %s""".format(doctype), (newname, oldname))
frappe.db.sql(
"UPDATE `tab{}` SET name = %s, to_rename = 0 where name = %s".format(doctype),
(newname, oldname),
auto_commit=True
)