From e7c2a996d1acb5804154a9e6a6d8c362e1dbf03c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 11 Aug 2014 13:39:41 +0530 Subject: [PATCH] [fix] Enclose add_fetch fields in '`' --- frappe/widgets/form/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/widgets/form/utils.py b/frappe/widgets/form/utils.py index 608ace7361..faccf33291 100644 --- a/frappe/widgets/form/utils.py +++ b/frappe/widgets/form/utils.py @@ -48,6 +48,9 @@ def validate_link(): # get fetch values if fetch: + # escape with "`" + fetch = ", ".join(("`{0}`".format(f.strip()) for f in fetch.split(","))) + frappe.response['fetch_values'] = [frappe.utils.parse_val(c) \ for c in frappe.db.sql("select %s from `tab%s` where name=%s" \ % (fetch, options, '%s'), (value,))[0]]