瀏覽代碼

Merge pull request #4656 from manassolanki/fix-12

fix the key error and add the default date-format in template
version-14
Saurabh 7 年之前
committed by GitHub
父節點
當前提交
3ea9f02de2
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 2 個檔案被更改,包括 3 行新增1 行删除
  1. +2
    -0
      frappe/core/doctype/data_import/exporter.py
  2. +1
    -1
      frappe/core/doctype/data_import/importer.py

+ 2
- 0
frappe/core/doctype/data_import/exporter.py 查看文件

@@ -165,6 +165,8 @@ def get_template(doctype=None, parent_doctype=None, all_doctypes="No", with_data
return 'Integer'
elif docfield.fieldtype == "Check":
return "0 or 1"
elif docfield.fieldtype in ["Date", "Datetime"]:
return cstr(frappe.defaults.get_defaults().date_format)
elif hasattr(docfield, "info"):
return docfield.info
else:


+ 1
- 1
frappe/core/doctype/data_import/importer.py 查看文件

@@ -210,7 +210,7 @@ def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False,
else:
return True

if autoname and not doc[autoname]:
if (autoname and autoname not in doc) or (autoname and not doc[autoname]):
frappe.throw(_("{0} is a mandatory field".format(autoname)))
return True



Loading…
取消
儲存