From 1c24dae0995ca7ba0cf4288b86f0f77ddcf8c0f6 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 7 Feb 2018 12:29:10 +0530 Subject: [PATCH] [hotfix] Docname as int (#4976) * [hotfix] Docname passed as number * typo --- frappe/database.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frappe/database.py b/frappe/database.py index 87623a93e1..990ddf37be 100644 --- a/frappe/database.py +++ b/frappe/database.py @@ -396,6 +396,10 @@ class Database: conditions.append(condition) + if isinstance(filters, int): + # docname is a number, convert to string + filters = str(filters) + if isinstance(filters, string_types): filters = { "name": filters } @@ -611,7 +615,7 @@ class Database: order_by = ("order by " + order_by) if order_by else "" r = self.sql("select {0} from `tab{1}` {2} {3} {4}" - .format(fl, doctype, "where" if conditions else "", conditions, order_by), values, + .format(fl, doctype, "where" if conditions else "", conditions, order_by), values, as_dict=as_dict, debug=debug, update=update) return r