浏览代码

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

version-14
Manas Solanki 7 年前
committed by Nabin Hait
父节点
当前提交
98036fd018
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      frappe/core/doctype/data_import/importer.py

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

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

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

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


正在加载...
取消
保存