mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 15:11:52 +00:00
fix: exclude virtual child doctypes from deletion in transaction deletion record
(cherry picked from commit 8bd8b28207)
This commit is contained in:
@@ -318,12 +318,23 @@ class TransactionDeletionRecord(Document):
|
|||||||
Returns:
|
Returns:
|
||||||
list: List of child table DocType names (Table field options)
|
list: List of child table DocType names (Table field options)
|
||||||
"""
|
"""
|
||||||
return frappe.get_all(
|
child_tables = frappe.get_all(
|
||||||
"DocField",
|
"DocField",
|
||||||
filters={"parent": doctype_name, "fieldtype": ["in", ["Table", "Table MultiSelect"]]},
|
filters={"parent": doctype_name, "fieldtype": ["in", ["Table", "Table MultiSelect"]]},
|
||||||
pluck="options",
|
pluck="options",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not child_tables:
|
||||||
|
return []
|
||||||
|
|
||||||
|
child_tables = frappe.get_all(
|
||||||
|
"DocType",
|
||||||
|
filters={"name": ["in", child_tables], "is_virtual": 0},
|
||||||
|
pluck="name",
|
||||||
|
)
|
||||||
|
|
||||||
|
return child_tables
|
||||||
|
|
||||||
def _get_to_delete_row_infos(self, doctype_name, company_field=None, company=None):
|
def _get_to_delete_row_infos(self, doctype_name, company_field=None, company=None):
|
||||||
"""Get child tables and document count for a To Delete list row
|
"""Get child tables and document count for a To Delete list row
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user