fix: Don't add property value if NoneType or Falsy

This commit is contained in:
Gavin D'souza 2022-01-12 14:50:27 +05:30
parent 36a0ecde77
commit 6502c4b340

View file

@ -264,9 +264,9 @@ 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 d[fieldname] == None:
if d[fieldname] is None:
_val = getattr(self, fieldname, None)
if not callable(_val):
if _val and not callable(_val):
d[fieldname] = _val
if convert_dates_to_str and isinstance(d[fieldname], (