From d998d520fb9a6a895a1fa58cd67bb8a544299ee9 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 24 Apr 2025 18:41:07 +0530 Subject: [PATCH] perf: use raw query for reading int-pk docs too (#32286) Currently only string PK is supported but that wasn't the intention, isinstance check is only there to avoid dicts/filters. --- frappe/model/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/model/document.py b/frappe/model/document.py index 4073da49f3..bc99cbf507 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -231,7 +231,7 @@ class Document(BaseDocument, DocRef): self._fix_numeric_types() else: - if not is_doctype and isinstance(self.name, str): + if not is_doctype and isinstance(self.name, str | int): for_update = "" if self.flags.for_update and frappe.db.db_type != "sqlite": for_update = "FOR UPDATE"