From 81553711625237ddeb3131f36fe0f8dc25babed5 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 14 Jun 2023 18:21:55 +0530 Subject: [PATCH] fix: ignore DOCTYPES_FOR_DOCTYPE in issingle check (#21375) --- frappe/model/utils/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frappe/model/utils/__init__.py b/frappe/model/utils/__init__.py index 5baf6f3787..f8f5b21de4 100644 --- a/frappe/model/utils/__init__.py +++ b/frappe/model/utils/__init__.py @@ -136,8 +136,10 @@ def is_virtual_doctype(doctype: str): @site_cache() -def is_single_doctype(doctype: str): - try: - return frappe.db.get_value("DocType", doctype, "issingle") - except Exception: +def is_single_doctype(doctype: str) -> bool: + from frappe.model.base_document import DOCTYPES_FOR_DOCTYPE + + if doctype in DOCTYPES_FOR_DOCTYPE: return False + + return frappe.db.get_value("DocType", doctype, "issingle")