mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 01:34:10 +00:00
fix(transaction-deletion): Add virtual doctypes to the list of ignored doctypes (backport #51063) (#51086)
* fix: Add virtual doctypes to the list of ignored doctypes in transaction deletion (cherry picked from commitc7a7cb2b90) * refactor: switch to `or_filters` so the query hits the DB only once (cherry picked from commit45a7195abe) * refactor: remove redundant assignment of doctypes_to_be_ignored_list (cherry picked from commit0f7d89f4d1) --------- Co-authored-by: KerollesFathy <kerollesfhabib@gmail.com>
This commit is contained in:
@@ -309,8 +309,9 @@ class TransactionDeletionRecord(Document):
|
||||
self.db_set("error_log", None)
|
||||
|
||||
def get_doctypes_to_be_ignored_list(self):
|
||||
singles = frappe.get_all("DocType", filters={"issingle": 1}, pluck="name")
|
||||
doctypes_to_be_ignored_list = singles
|
||||
doctypes_to_be_ignored_list = frappe.get_all(
|
||||
"DocType", or_filters=[["issingle", "=", 1], ["is_virtual", "=", 1]], pluck="name"
|
||||
)
|
||||
for doctype in self.doctypes_to_be_ignored:
|
||||
doctypes_to_be_ignored_list.append(doctype.doctype_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user