Merge pull request #36853 from barredterra/rename-virtual-doctype
fix: skip db changes while renaming virtual doctype
This commit is contained in:
commit
81d82a088a
2 changed files with 4 additions and 1 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue