From 10c436323abc739852283d51330de38a67cb445f Mon Sep 17 00:00:00 2001 From: venkata akhil Date: Fri, 6 Oct 2023 18:21:12 +0530 Subject: [PATCH] MST and publish mapping --- .../module_publish_mapping.json | 35 +++++++------------ .../special_tool_information.js | 5 ++- .../special_tool_information.json | 3 +- .../special_tool_information.py | 2 +- 4 files changed, 17 insertions(+), 28 deletions(-) diff --git a/smart_service/phase_2/doctype/module_publish_mapping/module_publish_mapping.json b/smart_service/phase_2/doctype/module_publish_mapping/module_publish_mapping.json index 9814959..66ef7d8 100644 --- a/smart_service/phase_2/doctype/module_publish_mapping/module_publish_mapping.json +++ b/smart_service/phase_2/doctype/module_publish_mapping/module_publish_mapping.json @@ -51,78 +51,67 @@ "default": "0", "fieldname": "automotive_system", "fieldtype": "Check", - "label": "Automotive System", - "read_only": 1 + "label": "Automotive System" }, { "default": "0", "fieldname": "tsb", "fieldtype": "Check", - "label": "TSB", - "read_only": 1 + "label": "TSB" }, { "default": "0", "fieldname": "fsa", "fieldtype": "Check", - "label": "FSA", - "read_only": 1 + "label": "FSA" }, { "default": "0", "fieldname": "tekalert", "fieldtype": "Check", - "label": "TEKalert", - "read_only": 1 + "label": "TEKalert" }, { "default": "0", "fieldname": "feature_finder", "fieldtype": "Check", - "label": "Feature Finder", - "read_only": 1 + "label": "Feature Finder" }, { "default": "0", "fieldname": "repairservice_check_sheet", "fieldtype": "Check", - "label": "Repair/Service Check Sheet", - "read_only": 1 + "label": "Repair/Service Check Sheet" }, { "default": "0", "fieldname": "mahindra_special_tool_information", "fieldtype": "Check", - "label": "Mahindra Special Tool Information", - "read_only": 1 + "label": "Mahindra Special Tool Information" }, { "default": "0", "fieldname": "training_information", "fieldtype": "Check", - "label": "Training Information", - "read_only": 1 + "label": "Training Information" }, { "default": "0", "fieldname": "qwik_service", "fieldtype": "Check", - "label": "QWIK Service", - "read_only": 1 + "label": "QWIK Service" }, { "default": "0", "fieldname": "pdi_inspection", "fieldtype": "Check", - "label": "PDI Inspection", - "read_only": 1 + "label": "PDI Inspection" }, { "default": "0", "fieldname": "torque_information_nm", "fieldtype": "Check", - "label": "Torque Information NM", - "read_only": 1 + "label": "Torque Information NM" }, { "fieldname": "publish_type", @@ -156,7 +145,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-10-06 12:18:41.170342", + "modified": "2023-10-06 18:04:11.661649", "modified_by": "Administrator", "module": "Phase-2", "name": "Module Publish Mapping", diff --git a/smart_service/phase_2/doctype/special_tool_information/special_tool_information.js b/smart_service/phase_2/doctype/special_tool_information/special_tool_information.js index 7c36075..586a8f2 100644 --- a/smart_service/phase_2/doctype/special_tool_information/special_tool_information.js +++ b/smart_service/phase_2/doctype/special_tool_information/special_tool_information.js @@ -272,10 +272,8 @@ frappe.ui.form.on('Instructions', { refresh_field("instructions"); }, content_type: function (frm, cdt, cdn) { - // refresh_field("instructions") var select_value = locals[cdt][cdn]; var x = select_value.idx - 1; - // let my_row = frm.fields_dict.content.grid.grid_rows[x]; if (select_value.content_type == 'Image' || select_value.content_type == 'Video' || select_value.content_type == 'PDF'){ cur_frm.get_field("instructions").grid.grid_rows[x].columns.content.df.read_only = 1; cur_frm.get_field("instructions").grid.grid_rows[x].columns.attach_file.df.read_only = 0; @@ -290,13 +288,14 @@ frappe.ui.form.on('Instructions', { cur_frm.get_field("instructions").grid.grid_rows[x].columns.title.df.read_only = 0; cur_frm.refresh_fields("content_type") } + frm.reload_doc() cur_frm.refresh_fields("content_type") refresh_field("instructions"); }, }) function check_field_character(field_name) { if (field_name) { - var alphanum = /^[a-zA-Z]+/; + var alphanum = /^[0-9a-zA-Z_-]+/; if (field_name.length > 1) { if (field_name.length > 100) { frappe.throw("Tool Name: Only 100 characters are allowed") 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 d848eb2..4dcfa2a 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 @@ -153,6 +153,7 @@ "fieldtype": "Column Break" }, { + "description": "Upload *.mp4 max 100 MB", "fieldname": "video", "fieldtype": "Attach", "label": "Video" @@ -186,7 +187,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-10-06 12:05:44.002461", + "modified": "2023-10-06 16:54:21.868057", "modified_by": "Administrator", "module": "Phase-2", "name": "Special Tool Information", diff --git a/smart_service/phase_2/doctype/special_tool_information/special_tool_information.py b/smart_service/phase_2/doctype/special_tool_information/special_tool_information.py index 9f503e8..bc4f81d 100644 --- a/smart_service/phase_2/doctype/special_tool_information/special_tool_information.py +++ b/smart_service/phase_2/doctype/special_tool_information/special_tool_information.py @@ -132,7 +132,7 @@ def file_validation1(image,video, name, value=None): if size > 1*1024 and image: val = delete_file(image) if val == True: - return (False, 2) + return (False, 2) else: return True else: