From bffe5fb2cf6d0c06f8ed1dcdbbaabaefe226ba34 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 10 Jul 2013 14:16:59 +0530 Subject: [PATCH] [fix][hr] pull salary structure in salary slip --- webnotes/model/mapper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webnotes/model/mapper.py b/webnotes/model/mapper.py index ddc0d8a2e3..ae9db6c3ce 100644 --- a/webnotes/model/mapper.py +++ b/webnotes/model/mapper.py @@ -37,10 +37,13 @@ def get_mapped_doclist(from_doctype, from_docname, table_maps, target_doclist=[] source_meta = webnotes.get_doctype(from_doctype) target_meta = webnotes.get_doctype(table_maps[from_doctype]["doctype"]) - + # main if target_doclist: - target_doc = webnotes.doc(target_doclist[0]) + if isinstance(target_doclist[0], dict): + target_doc = webnotes.doc(fielddata=target_doclist[0]) + else: + target_doc = target_doclist[0] else: target_doc = webnotes.new_doc(table_maps[from_doctype]["doctype"])