[fix] get_valid_dict use default if none
This commit is contained in:
parent
b208dcb16b
commit
8a87064541
1 changed files with 4 additions and 0 deletions
|
|
@ -208,6 +208,10 @@ class BaseDocument(object):
|
|||
if isinstance(d[fieldname], list) and df.fieldtype != 'Table':
|
||||
frappe.throw(_('Value for {0} cannot be a list').format(_(df.label)))
|
||||
|
||||
# get the default value if none, for insert / update
|
||||
if d[fieldname]==None and df.default:
|
||||
d[fieldname] = df.default
|
||||
|
||||
return d
|
||||
|
||||
def init_valid_columns(self):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue