Merge branch 'responsive' of git://github.com/webnotes/wnframework into responsive

This commit is contained in:
Nabin Hait 2013-07-04 16:30:24 +05:30
commit 973fa7674e

View file

@ -26,7 +26,9 @@ from webnotes import _
from webnotes.utils import cstr
from webnotes.model import default_fields
def get_mapped_doclist(from_doctype, from_docname, table_maps, target_doclist=[]):
def get_mapped_doclist(from_doctype, from_docname, table_maps, target_doclist=[], postprocess=None):
if isinstance(target_doclist, basestring):
target_doclist = json.loads(basestring)
if not webnotes.has_permission(from_doctype, from_docname):
webnotes.msgprint("No Permission", raise_exception=webnotes.PermissionError)
@ -59,6 +61,9 @@ def get_mapped_doclist(from_doctype, from_docname, table_maps, target_doclist=[]
map_doc(source_d, target_d, table_maps[source_d.doctype], source_meta, target_meta)
doclist.append(target_d)
if postprocess:
postprocess(source, doclist)
return doclist
def map_doc(source_doc, target_doc, table_map, source_meta, target_meta):