Browse Source

MST update

version2
venkataakhil 1 year ago
parent
commit
b0d435934c
  1. 64
      smart_service/phase_2/doctype/instructions/instructions.json
  2. 49
      smart_service/phase_2/doctype/module_publish_mapping/module_publish_mapping.json
  3. 3
      smart_service/phase_2/doctype/special_tool_information/special_tool_information.js
  4. 12
      smart_service/phase_2/doctype/special_tool_information/special_tool_information.py

64
smart_service/phase_2/doctype/instructions/instructions.json

@ -1,64 +0,0 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2023-09-21 17:56:22.177272",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"step_name",
"content_type",
"title",
"content",
"attach_file"
],
"fields": [
{
"fieldname": "step_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Step Name"
},
{
"fieldname": "content_type",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Content Type",
"options": "Heading\nDescription\nCaution\nWarning\nNotice\nImage\nVideo\nPDF",
"read_only_depends_on": "// eval:doc.content_type == 'PDF'",
"set_only_once": 1
},
{
"fieldname": "content",
"fieldtype": "Small Text",
"in_list_view": 1,
"label": "Content",
"read_only_depends_on": "// eval:doc.content_type=='Image'"
},
{
"depends_on": "// eval:doc.content_type == 'Image'",
"fieldname": "attach_file",
"fieldtype": "Attach",
"in_list_view": 1,
"label": "Attach File",
"read_only_depends_on": "// eval:doc.content_type =='Heading';"
},
{
"fieldname": "title",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Title"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2023-10-05 17:29:43.636314",
"modified_by": "Administrator",
"module": "Phase-2",
"name": "Instructions",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
}

49
smart_service/phase_2/doctype/module_publish_mapping/module_publish_mapping.json

@ -1,6 +1,4 @@
{
"_comments": "[]",
"_liked_by": "[]",
"actions": [],
"allow_rename": 1,
"autoname": "format:{vehicle}-{variant}-{language}-{publish_type}",
@ -34,83 +32,97 @@
{
"fieldname": "vehicle",
"fieldtype": "Data",
"label": "Vehicle"
"label": "Vehicle",
"set_only_once": 1
},
{
"fieldname": "variant",
"fieldtype": "Data",
"label": "Variant"
"label": "Variant",
"set_only_once": 1
},
{
"fieldname": "language",
"fieldtype": "Data",
"label": "Language"
"label": "Language",
"set_only_once": 1
},
{
"default": "0",
"fieldname": "automotive_system",
"fieldtype": "Check",
"label": "Automotive System"
"label": "Automotive System",
"read_only": 1
},
{
"default": "0",
"fieldname": "tsb",
"fieldtype": "Check",
"label": "TSB"
"label": "TSB",
"read_only": 1
},
{
"default": "0",
"fieldname": "fsa",
"fieldtype": "Check",
"label": "FSA"
"label": "FSA",
"read_only": 1
},
{
"default": "0",
"fieldname": "tekalert",
"fieldtype": "Check",
"label": "TEKalert"
"label": "TEKalert",
"read_only": 1
},
{
"default": "0",
"fieldname": "feature_finder",
"fieldtype": "Check",
"label": "Feature Finder"
"label": "Feature Finder",
"read_only": 1
},
{
"default": "0",
"fieldname": "repairservice_check_sheet",
"fieldtype": "Check",
"label": "Repair/Service Check Sheet"
"label": "Repair/Service Check Sheet",
"read_only": 1
},
{
"default": "0",
"fieldname": "mahindra_special_tool_information",
"fieldtype": "Check",
"label": "Mahindra Special Tool Information"
"label": "Mahindra Special Tool Information",
"read_only": 1
},
{
"default": "0",
"fieldname": "training_information",
"fieldtype": "Check",
"label": "Training Information"
"label": "Training Information",
"read_only": 1
},
{
"default": "0",
"fieldname": "qwik_service",
"fieldtype": "Check",
"label": "QWIK Service"
"label": "QWIK Service",
"read_only": 1
},
{
"default": "0",
"fieldname": "pdi_inspection",
"fieldtype": "Check",
"label": "PDI Inspection"
"label": "PDI Inspection",
"read_only": 1
},
{
"default": "0",
"fieldname": "torque_information_nm",
"fieldtype": "Check",
"label": "Torque Information NM"
"label": "Torque Information NM",
"read_only": 1
},
{
"fieldname": "publish_type",
@ -118,7 +130,8 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Publish Type",
"options": "\nInternal\nGlobal"
"options": "\nInternal\nGlobal",
"set_only_once": 1
},
{
"fieldname": "column_break_2y76a",
@ -143,7 +156,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-09-04 17:40:33.938964",
"modified": "2023-10-06 12:18:41.170342",
"modified_by": "Administrator",
"module": "Phase-2",
"name": "Module Publish Mapping",

3
smart_service/phase_2/doctype/special_tool_information/special_tool_information.js

@ -63,7 +63,8 @@ frappe.ui.form.on('Special Tool Information', {
}
});
}
frm.doc.name = frm.doc.vehicle + "-" + frm.doc.tool_type + "-" + frm.doc.category + "-" + frm.doc.aggregate_name
// frm.doc.name = frm.doc.vehicle + "-" + frm.doc.tool_type + "-" + frm.doc.category + "-" + frm.doc.aggregate_name
if (frm.doc.image) {
frappe.call({

12
smart_service/phase_2/doctype/special_tool_information/special_tool_information.py

@ -4,11 +4,13 @@
import frappe
from frappe.model.document import Document
class SpecialToolInformation(Document):
def validate(self):
# self.name=""
if self.is_new():
count = frappe.db.sql('''select max(my_id) as max_count from `tabSpecial Tool Information`;''')
count = frappe.db.sql(
'''select max(my_id) as max_count from `tabSpecial Tool Information`;''')
if count[0][0] is not None:
self.my_id = count[0][0] + 1
else:
@ -27,6 +29,7 @@ class SpecialToolInformation(Document):
if not self.is_new() and self.published == 1:
self.published = 0
@frappe.whitelist()
def file_validation(image, name, value=None):
from smart_service.apis.utils import check_png_ext, check_img_ext, check_zip_ext, check_pdf_ext, checking_image, details_of_image, check_mp4_ext, get_file_size
@ -53,13 +56,15 @@ def file_validation(image, name, value=None):
else:
return True
else:
val = checking_image(image, 'Special Tool Information', value, name)
val = checking_image(
image, 'Special Tool Information', value, name)
if res == False:
ret = res
else:
ret = res1
return ret, 1
@frappe.whitelist()
def file_validation_child(name, value=None):
from smart_service.apis.utils import check_png_ext, check_img_ext, check_zip_ext, check_pdf_ext, details_of_image, checking_image, check_mp4_ext, get_file_size
@ -112,6 +117,3 @@ def file_validation_child(name, value=None):
d['attach_file'], 'Special Tool Information', value, name, 1)
frappe.delete_doc('Instructions', d['name'])
return (ret, d['idx'])

Loading…
Cancel
Save