Browse Source

fix the key error and add the default date-format in template

version-14
Manas Solanki 7 years ago
parent
commit
54b590653b
2 changed files with 3 additions and 1 deletions
  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 View File

@@ -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 View File

@@ -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…
Cancel
Save