Merge pull request #36853 from barredterra/rename-virtual-doctype

fix: skip db changes while renaming virtual doctype
This commit is contained in:
Sagar Vora 2026-02-09 06:37:42 +00:00 committed by GitHub
commit 81d82a088a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -680,7 +680,7 @@ class DocType(Document):
where doctype=%s and field='name' and value = %s""",
(new, new, old),
)
else:
elif not self.is_virtual:
frappe.db.rename_table(old, new)
frappe.db.commit()

View file

@ -649,6 +649,9 @@ def update_parenttype_values(old: str, new: str):
child_doctypes = set(list(d["options"] for d in child_doctypes) + property_setter_child_doctypes)
for doctype in child_doctypes:
if frappe.get_meta(doctype).is_virtual:
continue
table = frappe.qb.DocType(doctype)
frappe.qb.update(table).set(table.parenttype, new).where(table.parenttype == old).run()