fix: as_dict
- convert_dates_to_str should work for non df fields
This commit is contained in:
parent
cd3ee90262
commit
fbfa078147
1 changed files with 2 additions and 2 deletions
|
|
@ -233,8 +233,8 @@ class BaseDocument(object):
|
|||
if isinstance(d[fieldname], list) and df.fieldtype not in table_fields:
|
||||
frappe.throw(_('Value for {0} cannot be a list').format(_(df.label)))
|
||||
|
||||
if convert_dates_to_str and isinstance(d[fieldname], (datetime.datetime, datetime.time, datetime.timedelta)):
|
||||
d[fieldname] = str(d[fieldname])
|
||||
if convert_dates_to_str and isinstance(d[fieldname], (datetime.datetime, datetime.time, datetime.timedelta)):
|
||||
d[fieldname] = str(d[fieldname])
|
||||
|
||||
if d[fieldname] == None and ignore_nulls:
|
||||
del d[fieldname]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue