#NEWLINE# def map_doc( source_doc , target_doc , table_map , source_parent = None ) : #NEWLINE# #INDENT# if table_map . get ( 'validation' ) : #NEWLINE# #INDENT# for ( key , condition ) in table_map [ 'validation' ] . items ( ) : #NEWLINE# #INDENT# if ( condition [ 0 ] == '=' ) : #NEWLINE# #INDENT# if ( source_doc . get ( key ) != condition [ 1 ] ) : #NEWLINE# #INDENT# frappe . throw ( ( ( ( _ ( 'Cannot map because following condition fails: ' ) + key ) + '=' ) + cstr ( condition [ 1 ] ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# map_fields ( source_doc , target_doc , table_map , source_parent ) #NEWLINE# if ( 'postprocess' in table_map ) : #NEWLINE# #INDENT# table_map [ 'postprocess' ] ( source_doc , target_doc , source_parent )