diff --git a/frappe/core/doctype/data_import/exporter.py b/frappe/core/doctype/data_import/exporter.py index 4a0a133651..9a8ca42b24 100644 --- a/frappe/core/doctype/data_import/exporter.py +++ b/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: diff --git a/frappe/core/doctype/data_import/importer.py b/frappe/core/doctype/data_import/importer.py index 8dcc129309..95336c84b3 100644 --- a/frappe/core/doctype/data_import/importer.py +++ b/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