Merge pull request #5312 from achillesrasquinha/fixes
Fix in case DocType Not found for cast_singles
This commit is contained in:
commit
bb8bfb647a
1 changed files with 8 additions and 5 deletions
|
|
@ -39,12 +39,15 @@ import pymysql
|
|||
def _cast_result(doctype, result):
|
||||
batch = [ ]
|
||||
|
||||
for field, value in result:
|
||||
df = frappe.get_meta(doctype).get_field(field)
|
||||
if df:
|
||||
value = cast_fieldtype(df.fieldtype, value)
|
||||
try:
|
||||
for field, value in result:
|
||||
df = frappe.get_meta(doctype).get_field(field)
|
||||
if df:
|
||||
value = cast_fieldtype(df.fieldtype, value)
|
||||
|
||||
batch.append(tuple([field, value]))
|
||||
batch.append(tuple([field, value]))
|
||||
except frappe.exceptions.DoesNotExistError:
|
||||
return result
|
||||
|
||||
return tuple(batch)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue