Kaynağa Gözat

[fix] mapper.py

version-14
Rushabh Mehta 8 yıl önce
ebeveyn
işleme
9ba8a4a23a
1 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. +5
    -2
      frappe/model/mapper.py

+ 5
- 2
frappe/model/mapper.py Dosyayı Görüntüle

@@ -18,7 +18,10 @@ def make_mapped_doc(method, source_name, selected_children=None):
if method not in frappe.whitelisted: if method not in frappe.whitelisted:
raise frappe.PermissionError raise frappe.PermissionError


frappe.flags.selected_children = selected_children
if selected_children:
selected_children = json.loads(selected_children)

frappe.flags.selected_children = selected_children or None


return method(source_name) return method(source_name)


@@ -71,7 +74,7 @@ def get_mapped_doc(from_doctype, from_docname, table_maps, target_doc=None,
# and this record is not in the selected children, then continue # and this record is not in the selected children, then continue
if (frappe.flags.selected_children if (frappe.flags.selected_children
and (df.fieldname in frappe.flags.selected_children) and (df.fieldname in frappe.flags.selected_children)
and source_d.name not in frappe.flags.selected_children):
and source_d.name not in frappe.flags.selected_children[df.fieldname]):
continue continue


target_child_doctype = table_map["doctype"] target_child_doctype = table_map["doctype"]


Yükleniyor…
İptal
Kaydet