@frappe.whitelist()
def make_mapped_doc(method, source_name, selected_children=None):
 method = frappe.get_attr(method)
 if (method not in frappe.whitelisted):
  raise frappe.PermissionError
 if selected_children:
  selected_children = json.loads(selected_children)
 frappe.flags.selected_children = (selected_children or None)
 return method(source_name)

@ frappe . whitelist ( ) def make_mapped_doc ( method , source_name , selected_children = None ) : method = frappe . get_attr ( method ) if ( method not in frappe . whitelisted ) : raise frappe . PermissionError if selected_children : selected_children = json . loads ( selected_children ) frappe . flags . selected_children = ( selected_children or None ) return method ( source_name )
returns the mapped document calling the given mapper method .