Browse Source

don't throw error if there is autoname controller (#4687)

version-14
Manas Solanki 7 years ago
committed by Nabin Hait
parent
commit
98036fd018
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      frappe/core/doctype/data_import/importer.py

+ 3
- 1
frappe/core/doctype/data_import/importer.py View File

@@ -211,7 +211,9 @@ def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False,
return True return True


if (autoname and autoname not in doc) or (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)))
from frappe.model.base_document import get_controller
if not hasattr(get_controller(doctype), "autoname"):
frappe.throw(_("{0} is a mandatory field".format(autoname)))
return True return True


users = frappe.db.sql_list("select name from tabUser") users = frappe.db.sql_list("select name from tabUser")


Loading…
Cancel
Save