fix: Accurately cast fieldtype in frappe.db.get_single_value()
This commit is contained in:
parent
9fdde15841
commit
a1e84d2341
1 changed files with 2 additions and 3 deletions
|
|
@ -15,7 +15,7 @@ from frappe import _
|
|||
from time import time
|
||||
from frappe.utils import now, getdate, cast_fieldtype, get_datetime
|
||||
from frappe.model.utils.link_count import flush_local_link_count
|
||||
from frappe.utils import cint
|
||||
from frappe.utils import cint, cast_fieldtype
|
||||
|
||||
|
||||
class Database(object):
|
||||
|
|
@ -556,8 +556,7 @@ class Database(object):
|
|||
if not df:
|
||||
frappe.throw(_('Invalid field name: {0}').format(frappe.bold(fieldname)), self.InvalidColumnName)
|
||||
|
||||
if df.fieldtype in frappe.model.numeric_fieldtypes:
|
||||
val = cint(val)
|
||||
val = cast_fieldtype(df.fieldtype, val)
|
||||
|
||||
self.value_cache[doctype][fieldname] = val
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue