瀏覽代碼

[fix] get_valid_dict use default if none

version-14
Rushabh Mehta 8 年之前
父節點
當前提交
8a87064541
共有 1 個檔案被更改,包括 4 行新增0 行删除
  1. +4
    -0
      frappe/model/base_document.py

+ 4
- 0
frappe/model/base_document.py 查看文件

@@ -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…
取消
儲存