allow null when time field is not required (#5832)

* allow null when time field is not required

* Update base_document.py
This commit is contained in:
Mohamed_Alsum 2018-07-23 07:06:42 +02:00 committed by Rushabh Mehta
parent 6a06e65d20
commit 803f6b0c7b

View file

@ -206,7 +206,7 @@ class BaseDocument(object):
elif df.fieldtype in ("Currency", "Float", "Percent") and not isinstance(d[fieldname], float):
d[fieldname] = flt(d[fieldname])
elif df.fieldtype in ("Datetime", "Date") and d[fieldname]=="":
elif df.fieldtype in ("Datetime", "Date", "Time") and d[fieldname]=="":
d[fieldname] = None
elif df.get("unique") and cstr(d[fieldname]).strip()=="":