fix: skip db changes while renaming virtual doctype

This commit is contained in:
barredterra 2026-02-08 17:44:04 +01:00
parent ace1fb081b
commit 251189a1e2
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()