mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-25 01:28:29 +00:00
refactor: switch to or_filters so the query hits the DB only once
This commit is contained in:
@@ -348,9 +348,10 @@ 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")
|
||||
virtuals = frappe.get_all("DocType", filters={"is_virtual": 1}, pluck="name")
|
||||
doctypes_to_be_ignored_list = singles + virtuals
|
||||
singles_and_virtuals = frappe.get_all(
|
||||
"DocType", or_filters=[["issingle", "=", 1], ["is_virtual", "=", 1]], pluck="name"
|
||||
)
|
||||
doctypes_to_be_ignored_list = singles_and_virtuals
|
||||
for doctype in self.doctypes_to_be_ignored:
|
||||
doctypes_to_be_ignored_list.append(doctype.doctype_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user