浏览代码

[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):
idx_map = {}
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:]):
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.parent = self.doc.name
if not d.idx:


正在加载...
取消
保存