Browse Source

Audit repor index error fix

master
venkataakhil 1 year ago
parent
commit
5959a39765
  1. 16
      smart_service/transactions/report/audit_report/audit_report.py

16
smart_service/transactions/report/audit_report/audit_report.py

@ -49,7 +49,6 @@ def get_data(filters):
if validation_flag: if validation_flag:
return data return data
else: else:
frappe.log_error('Audit report',str(data))
return [] return []
return data return data
@ -99,11 +98,13 @@ def modify_data(data_input, filter_parent):
for j in ss_map_append: for j in ss_map_append:
val = j['procedure_name'] val = j['procedure_name']
proc = j['procedure'] proc = j['procedure']
proc_map, proc_size = get_parent_map(ss_map[val], 'procedure_name') proc_map, proc_size = get_parent_map(
ss_map[val], 'procedure_name')
proc_values_dic = append_to_dic3( proc_values_dic = append_to_dic3(
proc_map, proc_size, j, indent=3, header=0, procedure=proc) proc_map, proc_size, j, indent=3, header=0, procedure=proc)
proc_length = status_length_append(proc_values_dic, 'Procedure') proc_length = status_length_append(
proc_values_dic, 'Procedure')
j['active_status'] = j['active_status'] + ' / ' + proc_length j['active_status'] = j['active_status'] + ' / ' + proc_length
list1.append(j) list1.append(j)
@ -122,10 +123,12 @@ def modify_data(data_input, filter_parent):
append_data = add_duplicate_data(list1) append_data = add_duplicate_data(list1)
append_data = remove_duplicate_and_header(append_data) append_data = remove_duplicate_and_header(append_data)
# frappe.msgprint(str(append_data))
return True, append_data return True, append_data
except Exception as e: except Exception as e:
frappe.log_error('Audit report_modify ',str(e)) frappe.log_error('Audit report', frappe.get_traceback())
return False, str(e) False, None
def append_to_dic1(map_data, indent, header): def append_to_dic1(map_data, indent, header):
map_data_append = [] map_data_append = []
@ -231,7 +234,8 @@ def append_to_dic3(map_data, proc_size, j, indent, header, procedure):
for cus in range(len(custom_lang)): for cus in range(len(custom_lang)):
if len(list1[cus]) > 0: if len(list1[cus]) > 0:
if i<len(list1[cus]):
# frappe.msgprint(str(list1[cus]))
if list1[cus][i][0] == 1: if list1[cus][i][0] == 1:
dic1['{}_active_status'.format(custom_lang[cus]['lang_code'])] = str( dic1['{}_active_status'.format(custom_lang[cus]['lang_code'])] = str(
list1[cus][i][0]) + " Step" list1[cus][i][0]) + " Step"

Loading…
Cancel
Save