From 9ba8a4a23a9eca57d9c753312fbb1f34f7a02257 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 15 Dec 2016 15:41:52 +0530 Subject: [PATCH] [fix] mapper.py --- frappe/model/mapper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frappe/model/mapper.py b/frappe/model/mapper.py index e7c55fe78b..d8384eee09 100644 --- a/frappe/model/mapper.py +++ b/frappe/model/mapper.py @@ -18,7 +18,10 @@ def make_mapped_doc(method, source_name, selected_children=None): if method not in frappe.whitelisted: 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) @@ -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 if (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 target_child_doctype = table_map["doctype"]