fix: ignore DOCTYPES_FOR_DOCTYPE in issingle check (#21375)

This commit is contained in:
Ankush Menat 2023-06-14 18:21:55 +05:30 committed by GitHub
parent 3f3ee12338
commit 8155371162
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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")