@ -238,13 +238,14 @@ def update_system_id(name):
sys_procedure = frappe . db . sql ( """ select systems,sub_systems,system_id,sub_system_id,`procedure` from {0} .`tabSystem Mapping_Sub System` where parent = ' {1} ' and `procedure` = ' {2} ' """ . format (
current_db_name , sm , table . temp_cnt ) , as_dict = True )
if sys_procedure :
frappe . msgprint ( str ( sys_procedure [ 0 ] [ ' procedure ' ] ) )
frappe . msgprint ( " sys_procedure " + str ( sys_procedure [ 0 ] [ ' procedure ' ] ) + str ( sys_procedure [ 0 ] [ ' sub_system_id ' ] ) )
if table . temp_cnt == sys_procedure [ 0 ] [ ' procedure ' ] :
frappe . msgprint ( " SSSS " + str ( sys_procedure [ 0 ] [ ' system_id ' ] ) )
sys_id = doc . variant_mapping + ' , ' + \
str ( sys_procedure [ 0 ] [ ' system_id ' ] ) + ' , ' + \
str ( sys_procedure [ 0 ] [ ' sub_system_id ' ] )
table . system_id = sys_id
frappe . msgprint ( str ( sys_id ) )
frappe . msgprint ( " ID " + str ( sys_id ) )
frappe . db . sql ( """ update {0} .`tabProcedure_Details` set system_id = ' {1} ' where parent = ' {2} ' and temp_cnt = ' {3} ' """ . format (
current_db_name , sys_id , doc . name , table . temp_cnt ) )
frappe . db . commit ( )