From 3ce4842d31df525e31ea36123a61c7b4d705a989 Mon Sep 17 00:00:00 2001 From: venkataakhil Date: Tue, 3 Oct 2023 16:07:25 +0530 Subject: [PATCH] MST key update --- smart_service/apis/v2/master.py | 9 +++++---- .../special_tool_information.json | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/smart_service/apis/v2/master.py b/smart_service/apis/v2/master.py index b3daa3a..c7d4bc4 100644 --- a/smart_service/apis/v2/master.py +++ b/smart_service/apis/v2/master.py @@ -176,7 +176,7 @@ def new_publish(): # flag, data = get_training_information(vehicle, language) pass - elif module == 'Special Tool Information': + elif module == 'Mahindra Special Tool Information': flag, data = get_special_tool_information(vehicle) elif module == 'PDI Inspection': @@ -240,6 +240,7 @@ def new_publish1(): data = data['data'] filter_json = filter_publish_json(data,variant) data = filter_json + elif module == 'Training Information': pass @@ -269,9 +270,9 @@ def get_special_tool_information(vehicle): # my_id,keywords from `tabSpecial Tool Information` # where vehicle="{vehicle}";''', as_dict=1) - special_tool_information = frappe.db.sql(''' select name,vehicle,tool_type,category,tool_name,aggregate_name,tool_image, - pdf,image,video,keywords,display_order,my_id,active_status from `tabSpecial Tool Information` - where vehicle= '%s' ;''' % (vehicle), as_dict=1) + special_tool_information = frappe.db.sql(''' select name,vehicle,tool_type,category,tool_name,aggregate_name, aggregate_image as 'tool_image', + pdf,image,video,keywords,display_order,my_id,active_status from `tabSpecial Tool Information` + where vehicle= '%s' ;''' % (vehicle), as_dict=1) for s in special_tool_information: # s['tool_usage_content'] = frappe.db.sql(f'''select idx as 'display_order',image,content,video,asset_type,active_status # from `tabMST Information Assets` where parent = '{s['name']}' order by display_order;''', as_dict=1) diff --git a/smart_service/phase_2/doctype/special_tool_information/special_tool_information.json b/smart_service/phase_2/doctype/special_tool_information/special_tool_information.json index b59a222..f8e9d8d 100644 --- a/smart_service/phase_2/doctype/special_tool_information/special_tool_information.json +++ b/smart_service/phase_2/doctype/special_tool_information/special_tool_information.json @@ -15,7 +15,6 @@ "column_break_m3p9i", "category", "aggregate_name", - "tool_image", "column_break_whk88", "tool_type", "tool_name", @@ -25,10 +24,9 @@ "teb_instructions", "keywords", "pdf", - "column_break_plwrg", "image", - "tool_name", - "tool_type" + "aggregate_image", + "video" ], "fields": [ { @@ -108,13 +106,13 @@ "set_only_once": 1 }, { - "depends_on": "eval:doc.category !='TEB';", + "depends_on": "eval:doc.category !='TEB';", "fieldname": "aggregate_image", "fieldtype": "Attach Image", "label": "Aggregate Image" }, { - "depends_on": "eval:doc.category !='TEB';", + "depends_on": "eval:doc.category !='TEB';", "fieldname": "pdf", "fieldtype": "Attach", "label": "PDF" @@ -126,7 +124,7 @@ "options": "Instructions" }, { - "depends_on": "eval:doc.category !='TEB';", + "depends_on": "eval:doc.category !='TEB';", "fieldname": "tool_name", "fieldtype": "Data", "label": "Tool Name" @@ -152,11 +150,16 @@ { "fieldname": "column_break_m3p9i", "fieldtype": "Column Break" + }, + { + "fieldname": "video", + "fieldtype": "Attach", + "label": "Video" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-09-27 11:59:38.479380", + "modified": "2023-10-03 12:24:34.313498", "modified_by": "Administrator", "module": "Phase-2", "name": "Special Tool Information",