Procházet zdrojové kódy

[Fix] Minor fix in data importer (#4690)

version-14
Manas Solanki před 7 roky
committed by Nabin Hait
rodič
revize
fa3c2a219d
1 změnil soubory, kde provedl 13 přidání a 12 odebrání
  1. +13
    -12
      frappe/core/doctype/data_import/importer.py

+ 13
- 12
frappe/core/doctype/data_import/importer.py Zobrazit soubor

@@ -201,19 +201,20 @@ def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False,
def validate_naming(doc):
autoname = frappe.get_meta(doctype).autoname

if ".#" in autoname or "hash" in autoname:
autoname = ""
elif autoname[0:5] == 'field':
autoname = autoname[6:]
elif autoname=='naming_series:':
autoname = 'naming_series'
else:
return True
if autoname:
if ".#" in autoname or "hash" in autoname:
autoname = ""
elif autoname[0:5] == 'field':
autoname = autoname[6:]
elif autoname=='naming_series:':
autoname = 'naming_series'
else:
return True

if (autoname and autoname not in doc) or (autoname and not doc[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)))
if (autoname not in doc) or (not doc[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")


Načítá se…
Zrušit
Uložit