From 5b3e58044f0d9156e0c10758ff166c73e22cd247 Mon Sep 17 00:00:00 2001 From: venkataakhil Date: Thu, 10 Aug 2023 14:39:09 +0530 Subject: [PATCH] remove master api test functions --- smart_service/apis/v2/master.py | 27 ----------- .../repair_service_master_mapping.js | 46 +++++++------------ 2 files changed, 16 insertions(+), 57 deletions(-) diff --git a/smart_service/apis/v2/master.py b/smart_service/apis/v2/master.py index 541b8df..8204891 100644 --- a/smart_service/apis/v2/master.py +++ b/smart_service/apis/v2/master.py @@ -67,33 +67,6 @@ def get_repair_service_mapping(vehicle, language): return False, e -@frappe.whitelist(methods=["POST"], allow_guest=1) -def old_get_feature_finder(vehicle, variant, language): - try: - feature_finder_details = frappe.db.sql(f"""select ff.name,ff.vehicle,ff.variant,ff.language,ff.feature_name,ff.translated_feature_name, - ff.feature_category,ff.feature_type,ff.display_order,ff.active_status,ffm.feature_pdf from `tabFeature Finder` ff - left join `tabFeature Finder Master` ffm on ff.vehicle = ffm.vehicle - where ff.vehicle = "{vehicle}" and ff.variant = "{variant}" - and ff.language = "{language}"; """, as_dict=1) - - for d in feature_finder_details: - d['disclaimer'] = frappe.db.sql(f''' - SELECT name,content,active_status,idx as display_order FROM `tabFeature Finder Disclaimer` - where parent = '{d['feature_name']}'; - ''', as_dict=1) - - d['images'] = frappe.db.sql(f""" select image,idx as display_order,active_status from `tabFeature Finder Images` where - parent = '{d['name']}';""", as_dict=1) - - d['content'] = frappe.db.sql(f"""select content,idx as display_order, active_status from `tabFeature Finder Content` - where parent = '{d['name']}';""", as_dict=1) - d['specification'] = frappe.db.sql(f"""select specification,value,idx as display_order,active_status from `tabFeature Finder Specification` - where parent = '{d['name']}';""", as_dict=1) - return True, feature_finder_details - except Exception as e: - return False, e - - @frappe.whitelist(methods=["POST"], allow_guest=1) def get_feature_finder(vehicle, variant, language): try: diff --git a/smart_service/phase_2/doctype/repair_service_master_mapping/repair_service_master_mapping.js b/smart_service/phase_2/doctype/repair_service_master_mapping/repair_service_master_mapping.js index 1851d17..35b3fdf 100644 --- a/smart_service/phase_2/doctype/repair_service_master_mapping/repair_service_master_mapping.js +++ b/smart_service/phase_2/doctype/repair_service_master_mapping/repair_service_master_mapping.js @@ -7,39 +7,26 @@ frappe.require('assets/smart_service/js/utils.js', () => {}) frappe.ui.form.on('Repair Service Master Mapping', { onload: function (frm) { // Set Display Order - - frm.set_query("check_list_name", function() { - return{ - "filters": { - "language": ["in", [frm.doc.language]], - } - } - }); + set_display_order(frm) + // frm.set_query("check_list_name", function() { + // return{ + // "filters": { + // "language": ["in", [frm.doc.language]], + // } + // } + // }); }, refresh: function (frm) { // Set Display Order - if (frm.is_new()) { - frm.set_df_property('display_order', 'read_only', 1); - } else { - frm.set_df_property('display_order', 'read_only', 0); - } - frappe.db.count('Repair Service Master Mapping') - .then(count => { - vehicle_count = count + 1; - if (frm.is_new()) { - frm.set_value("display_order", vehicle_count); - } else { - original_display_order = frm.doc.display_order; - } - }); - frm.set_query("check_list_name", function() { - return{ - "filters": { - "language": ["in", [frm.doc.language]], - } - } - }); + set_display_order(frm) + // frm.set_query("check_list_name", function() { + // return{ + // "filters": { + // "language": ["in", [frm.doc.language]], + // } + // } + // }); }, after_save:function(frm){ @@ -49,7 +36,6 @@ frappe.ui.form.on('Repair Service Master Mapping', { validate: function (frm){ //For Display Order cur_frm.refresh_fields("display_order") - // console.log(module_name_count,"----",original_display_order) display_order_validation(frm, vehicle_count, original_display_order,frm.doc.vehicle) },