Browse Source

Link field issue fix query

master
venkataakhil 1 year ago
parent
commit
34af0ab280
  1. 16
      smart_service/apis/publish_api.py
  2. 3
      smart_service/transactions/doctype/procedure_details/procedure_details.json

16
smart_service/apis/publish_api.py

@ -40,14 +40,14 @@ def custom_rate_limit(limit, seconds):
def get_parent_map(input_list, parameter):
parentChildMap = {}
parent_child_map = {}
for b in input_list:
parentChildMap.setdefault(b[parameter] or None, []).append(b)
parent_child_map.setdefault(b[parameter] or None, []).append(b)
list1 = []
for p in parentChildMap:
da = {"procedure_name": p, 'steps': parentChildMap[p]}
for p in parent_child_map:
da = {"procedure_name": p, 'steps': parent_child_map[p]}
list1.append(da)
for i in parentChildMap[p]:
for i in parent_child_map[p]:
del i['procedure_name']
del i['idx']
return list1
@ -211,7 +211,8 @@ def json_grouping(args, language):
# where parent ='{}' group by procedure_name,step_name,content_type,content order by idx asc; '''.format(
# current_db_name, k['procedure_link']), as_dict=True)
proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, content,
proc_details = frappe.db.sql('''select procedure_name, step_name, content_type,
case when content_type='Link' Then system_id else content end as content,
file,idx as display_order,idx from {}.tabProcedure_Details
where parent ='{}' order by idx asc; '''.format(current_db_name, k['procedure_link']), as_dict=True)
@ -863,7 +864,10 @@ def upv():
# frappe.db.commit()
return 1
""" Generate publish """
@frappe.whitelist()
def run_publish():
new_publish('THAR-en -2023-05-21 16:57:54.119826',

3
smart_service/transactions/doctype/procedure_details/procedure_details.json

@ -74,14 +74,13 @@
{
"fieldname": "system_id",
"fieldtype": "Data",
"hidden": 1,
"label": "System ID"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2022-04-08 22:21:10.666175",
"modified": "2023-05-29 13:33:52.112577",
"modified_by": "Administrator",
"module": "Transactions",
"name": "Procedure_Details",

Loading…
Cancel
Save