瀏覽代碼

[minor] [fix] in import, do not validate parentfield

version-14
Anand Doshi 12 年之前
父節點
當前提交
98b0353b66
共有 1 個檔案被更改,包括 8 行新增4 行删除
  1. +8
    -4
      webnotes/model/bean.py

+ 8
- 4
webnotes/model/bean.py 查看文件

@@ -211,12 +211,16 @@ class Bean:
def update_parent_info(self): def update_parent_info(self):
idx_map = {} idx_map = {}
is_local = cint(self.doc.fields.get("__islocal")) is_local = cint(self.doc.fields.get("__islocal"))
parentfields = [d.fieldname for d in self.meta.get({"doctype": "DocField", "fieldtype": "Table"})]
if not webnotes.in_import:
parentfields = [d.fieldname for d in self.meta.get({"doctype": "DocField", "fieldtype": "Table"})]
for i, d in enumerate(self.doclist[1:]): for i, d in enumerate(self.doclist[1:]):
if d.parentfield: if d.parentfield:
if not d.parentfield in parentfields:
webnotes.msgprint("Bad parentfield %s" % parentfield,
raise_exception=True)
if not webnotes.in_import:
if not d.parentfield in parentfields:
webnotes.msgprint("Bad parentfield %s" % parentfield,
raise_exception=True)
d.parenttype = self.doc.doctype d.parenttype = self.doc.doctype
d.parent = self.doc.name d.parent = self.doc.name
if not d.idx: if not d.idx:


Loading…
取消
儲存