Browse Source

update 2

master
hns 3 years ago
parent
commit
bcebf78730
  1. 36
      smart_service.egg-info/SOURCES.txt
  2. BIN
      smart_service/add_ons/doctype/model_hit/__pycache__/test_model_hit.cpython-38.pyc
  3. BIN
      smart_service/add_ons/doctype/model_usage/__pycache__/test_model_usage.cpython-38.pyc
  4. BIN
      smart_service/add_ons/report/__pycache__/__init__.cpython-38.pyc
  5. BIN
      smart_service/add_ons/report/_test/__pycache__/__init__.cpython-38.pyc
  6. BIN
      smart_service/add_ons/report/_test/__pycache__/_test.cpython-38.pyc
  7. 0
      smart_service/add_ons/report/feedback_report/__init__.py
  8. 9
      smart_service/add_ons/report/feedback_report/feedback_report.js
  9. 29
      smart_service/add_ons/report/feedback_report/feedback_report.json
  10. 8
      smart_service/add_ons/report/feedback_report/feedback_report.py
  11. BIN
      smart_service/add_ons/report/installation_report/__pycache__/__init__.cpython-38.pyc
  12. BIN
      smart_service/add_ons/report/installation_report/__pycache__/installation_report.cpython-38.pyc
  13. BIN
      smart_service/add_ons/report/login_report/__pycache__/__init__.cpython-38.pyc
  14. BIN
      smart_service/add_ons/report/login_report/__pycache__/login_report.cpython-38.pyc
  15. 0
      smart_service/add_ons/report/model_download_report/__init__.py
  16. BIN
      smart_service/add_ons/report/model_download_report/__pycache__/__init__.cpython-38.pyc
  17. BIN
      smart_service/add_ons/report/model_download_report/__pycache__/model_download_report.cpython-38.pyc
  18. 9
      smart_service/add_ons/report/model_download_report/model_download_report.js
  19. 29
      smart_service/add_ons/report/model_download_report/model_download_report.json
  20. 8
      smart_service/add_ons/report/model_download_report/model_download_report.py
  21. 0
      smart_service/add_ons/report/model_hit_report/__init__.py
  22. BIN
      smart_service/add_ons/report/model_hit_report/__pycache__/__init__.cpython-38.pyc
  23. BIN
      smart_service/add_ons/report/model_hit_report/__pycache__/model_hit_report.cpython-38.pyc
  24. 38
      smart_service/add_ons/report/model_hit_report/model_hit_report.js
  25. 29
      smart_service/add_ons/report/model_hit_report/model_hit_report.json
  26. 50
      smart_service/add_ons/report/model_hit_report/model_hit_report.py
  27. 0
      smart_service/add_ons/report/release_report/__init__.py
  28. 9
      smart_service/add_ons/report/release_report/release_report.js
  29. 30
      smart_service/add_ons/report/release_report/release_report.json
  30. 8
      smart_service/add_ons/report/release_report/release_report.py
  31. BIN
      smart_service/apis/__pycache__/addon_api.cpython-38.pyc
  32. BIN
      smart_service/apis/__pycache__/app_user_login.cpython-38.pyc
  33. BIN
      smart_service/apis/__pycache__/master_api.cpython-38.pyc
  34. BIN
      smart_service/apis/__pycache__/publish_api.cpython-38.pyc
  35. BIN
      smart_service/apis/__pycache__/update_validation.cpython-38.pyc
  36. 3
      smart_service/apis/addon_api.py
  37. 11
      smart_service/apis/app_user_login.py
  38. 12
      smart_service/apis/master_api.py
  39. 59
      smart_service/apis/publish_api.py
  40. 4
      smart_service/apis/transaction_api.py
  41. 55
      smart_service/apis/update_validation.py
  42. 870
      smart_service/json_files/Thar-en -2022-01-10 15:02:15.309338'.json
  43. 870
      smart_service/json_files/procedurePublish.json
  44. 25
      smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.py
  45. 6
      smart_service/mahindra_smart_service/report/_fuel_translation/_fuel_translation.py
  46. 4
      smart_service/mahindra_smart_service/report/_procedure_report/_procedure_report.py
  47. 34
      smart_service/mahindra_smart_service/report/_sub_systems_translation/_sub_systems_translation.py
  48. 25
      smart_service/mahindra_smart_service/report/_systems_translation/_systems_translation.py
  49. 26
      smart_service/mahindra_smart_service/report/_transmission_translation/_transmission_translation.py
  50. 3
      smart_service/mahindra_smart_service/report/_variant_translation/_variant_translation.py
  51. 25
      smart_service/mahindra_smart_service/report/_vehicle_segment_translation/_vehicle_segment_translation.py
  52. 26
      smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.py
  53. 2
      smart_service/masters/doctype/custom_languages/custom_languages.json
  54. 8
      smart_service/masters/doctype/variant/variant.json
  55. 92
      smart_service/masters/doctype/vehi_master/vehi_master.js
  56. 3
      smart_service/masters/doctype/vehi_master/vehi_master.json
  57. 2
      smart_service/masters/doctype/vehi_master_item/vehi_master_item.json
  58. 2
      smart_service/masters/doctype/vehicle/vehicle.json
  59. 29
      smart_service/templates/includes/login/_login.js
  60. BIN
      smart_service/transactions/doctype/publish/__pycache__/publish.cpython-38.pyc
  61. 6
      smart_service/transactions/doctype/publish/publish.py
  62. 0
      smart_service/transactions/report/__init__.py
  63. 0
      smart_service/transactions/report/audit_report/__init__.py
  64. 9
      smart_service/transactions/report/audit_report/audit_report.js
  65. 32
      smart_service/transactions/report/audit_report/audit_report.json
  66. 8
      smart_service/transactions/report/audit_report/audit_report.py

36
smart_service.egg-info/SOURCES.txt

@ -54,6 +54,16 @@ smart_service/add_ons/doctype/circular/circular.js
smart_service/add_ons/doctype/circular/circular.json
smart_service/add_ons/doctype/circular/circular.py
smart_service/add_ons/doctype/circular/test_circular.py
smart_service/add_ons/doctype/model_hit/__init__.py
smart_service/add_ons/doctype/model_hit/model_hit.js
smart_service/add_ons/doctype/model_hit/model_hit.json
smart_service/add_ons/doctype/model_hit/model_hit.py
smart_service/add_ons/doctype/model_hit/test_model_hit.py
smart_service/add_ons/doctype/model_usage/__init__.py
smart_service/add_ons/doctype/model_usage/model_usage.js
smart_service/add_ons/doctype/model_usage/model_usage.json
smart_service/add_ons/doctype/model_usage/model_usage.py
smart_service/add_ons/doctype/model_usage/test_model_usage.py
smart_service/add_ons/doctype/teknet_group/__init__.py
smart_service/add_ons/doctype/teknet_group/teknet_group.js
smart_service/add_ons/doctype/teknet_group/teknet_group.json
@ -79,6 +89,19 @@ smart_service/add_ons/doctype/user_manual/test_user_manual.py
smart_service/add_ons/doctype/user_manual/user_manual.js
smart_service/add_ons/doctype/user_manual/user_manual.json
smart_service/add_ons/doctype/user_manual/user_manual.py
smart_service/add_ons/report/__init__.py
smart_service/add_ons/report/_test/__init__.py
smart_service/add_ons/report/_test/_test.js
smart_service/add_ons/report/_test/_test.json
smart_service/add_ons/report/_test/_test.py
smart_service/add_ons/report/installation_report/__init__.py
smart_service/add_ons/report/installation_report/installation_report.js
smart_service/add_ons/report/installation_report/installation_report.json
smart_service/add_ons/report/installation_report/installation_report.py
smart_service/add_ons/report/login_report/__init__.py
smart_service/add_ons/report/login_report/login_report.js
smart_service/add_ons/report/login_report/login_report.json
smart_service/add_ons/report/login_report/login_report.py
smart_service/apis/addon_api.py
smart_service/apis/app_user_login.py
smart_service/apis/master_api.py
@ -88,6 +111,7 @@ smart_service/apis/update_validation.py
smart_service/config/__init__.py
smart_service/config/desktop.py
smart_service/config/docs.py
smart_service/json_files/Thar-en -2022-01-10 15:02:15.309338'.json
smart_service/json_files/procedurePublish.json
smart_service/mahindra_smart_service/__init__.py
smart_service/mahindra_smart_service/doctype/__init__.py
@ -100,6 +124,10 @@ smart_service/mahindra_smart_service/doctype/release_docs/__init__.py
smart_service/mahindra_smart_service/doctype/release_docs/release_docs.json
smart_service/mahindra_smart_service/doctype/release_docs/release_docs.py
smart_service/mahindra_smart_service/report/__init__.py
smart_service/mahindra_smart_service/report/_applog_translation/__init__.py
smart_service/mahindra_smart_service/report/_applog_translation/_applog_translation.js
smart_service/mahindra_smart_service/report/_applog_translation/_applog_translation.json
smart_service/mahindra_smart_service/report/_applog_translation/_applog_translation.py
smart_service/mahindra_smart_service/report/_drive_translation/__init__.py
smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.js
smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.json
@ -140,6 +168,14 @@ smart_service/mahindra_smart_service/report/_vehicle_translation/__init__.py
smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.js
smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.json
smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.py
smart_service/mahindra_smart_service/report/installation_report/__init__.py
smart_service/mahindra_smart_service/report/installation_report/installation_report.js
smart_service/mahindra_smart_service/report/installation_report/installation_report.json
smart_service/mahindra_smart_service/report/installation_report/installation_report.py
smart_service/mahindra_smart_service/report/login_report/__init__.py
smart_service/mahindra_smart_service/report/login_report/login_report.js
smart_service/mahindra_smart_service/report/login_report/login_report.json
smart_service/mahindra_smart_service/report/login_report/login_report.py
smart_service/masters/__init__.py
smart_service/masters/doctype/__init__.py
smart_service/masters/doctype/app_labels/__init__.py

BIN
smart_service/add_ons/doctype/model_hit/__pycache__/test_model_hit.cpython-38.pyc

Binary file not shown.

BIN
smart_service/add_ons/doctype/model_usage/__pycache__/test_model_usage.cpython-38.pyc

Binary file not shown.

BIN
smart_service/add_ons/report/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/add_ons/report/_test/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/add_ons/report/_test/__pycache__/_test.cpython-38.pyc

Binary file not shown.

0
smart_service/add_ons/report/feedback_report/__init__.py

9
smart_service/add_ons/report/feedback_report/feedback_report.js

@ -0,0 +1,9 @@
// Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Feedback Report"] = {
"filters": [
]
};

29
smart_service/add_ons/report/feedback_report/feedback_report.json

@ -0,0 +1,29 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2022-01-18 14:34:34.678690",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-18 14:38:51.113640",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Feedback Report",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Feedback",
"report_name": "Feedback Report",
"report_type": "Script Report",
"roles": [
{
"role": "_Admin"
},
{
"role": "System Manager"
}
]
}

8
smart_service/add_ons/report/feedback_report/feedback_report.py

@ -0,0 +1,8 @@
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
# import frappe
def execute(filters=None):
columns, data = [], []
return columns, data

BIN
smart_service/add_ons/report/installation_report/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/add_ons/report/installation_report/__pycache__/installation_report.cpython-38.pyc

Binary file not shown.

BIN
smart_service/add_ons/report/login_report/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/add_ons/report/login_report/__pycache__/login_report.cpython-38.pyc

Binary file not shown.

0
smart_service/add_ons/report/model_download_report/__init__.py

BIN
smart_service/add_ons/report/model_download_report/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/add_ons/report/model_download_report/__pycache__/model_download_report.cpython-38.pyc

Binary file not shown.

9
smart_service/add_ons/report/model_download_report/model_download_report.js

@ -0,0 +1,9 @@
// Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Model Download Report"] = {
"filters": [
]
};

29
smart_service/add_ons/report/model_download_report/model_download_report.json

@ -0,0 +1,29 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2022-01-18 14:37:03.336454",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-18 14:37:03.336454",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Model Download Report",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Model Usage",
"report_name": "Model Download Report",
"report_type": "Script Report",
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

8
smart_service/add_ons/report/model_download_report/model_download_report.py

@ -0,0 +1,8 @@
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
# import frappe
def execute(filters=None):
columns, data = [], []
return columns, data

0
smart_service/add_ons/report/model_hit_report/__init__.py

BIN
smart_service/add_ons/report/model_hit_report/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/add_ons/report/model_hit_report/__pycache__/model_hit_report.cpython-38.pyc

Binary file not shown.

38
smart_service/add_ons/report/model_hit_report/model_hit_report.js

@ -0,0 +1,38 @@
// Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Model Hit Report"] = {
"filters": [
{
"fieldname":"from_date",
"label": __("From Date"),
"fieldtype": "Date",
default: frappe.datetime.year_start(),
"reqd": 0
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
default: frappe.datetime.year_end(),
"reqd": 0
},
{
"fieldname":"model",
"label": __("Model"),
"fieldtype": "Link",
"options" : "App Users",
"reqd": 0
},
{
"fieldname":"variant",
"label": __("Variant"),
"fieldtype": "Link",
"options" : "App Device",
"reqd": 0
}
]
};

29
smart_service/add_ons/report/model_hit_report/model_hit_report.json

@ -0,0 +1,29 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2022-01-18 14:36:07.869475",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-18 14:36:07.869475",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Model Hit Report",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Model Hit",
"report_name": "Model Hit Report",
"report_type": "Script Report",
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

50
smart_service/add_ons/report/model_hit_report/model_hit_report.py

@ -0,0 +1,50 @@
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
def execute(filters=None):
columns, data = [], []
columns = get_columns()
data = get_data(filters)
return columns, data
def get_data(filters):
if filters.get('model') and filters.get('variant'):
data = frappe.db.sql("""select dealer.zone,au.user_id,au.first_name,dealer.dealer_code,dealer.dealer_name,dealer.area,ad.os,ad.os_version,
al.device,ad.device_id,ad.app_current_version,al.type,al.date_time_stamp,al.creation,date(al.date_time_stamp) as date,time(al.date_time_stamp) as time,time(al.date_time_stamp) as last_time
from `tabApp Log` al,`tabApp Device` ad,`tabModel Hit` au,`tabApp Dealer` dealer
where
ad.name = %s and al.device = %s and au.name = %s and au.dealer = dealer.name and al.type = 'Installed' and
(al.modified between %s and %s)""",(filters.get('device'),filters.get('device'),filters.get('user'),filters.get('from_date'), filters.get('to_date')), as_dict=1)
if data:
return data
else:
frappe.throw('No Data for Selected Filters.')
def get_columns():
columns = [
{"label": _("Date"), "fieldname": "date", "fieldtype": "Date", "width": 100},
{"label": _("Dealer Code"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 100},
{"label": _("Dealer Name"), "fieldname": "dealer_name", "fieldtype": "Data", "width": 100},
{"label": _("Dealer Location"), "fieldname": "area", "fieldtype": "Data", "width": 100},
{"label": _("Zone"), "fieldname": "zone", "fieldtype": "Data", "width": 100},
{"label": _("Device"), "fieldname": "device_type", "fieldtype": "Data", "width": 100},
{"label": _("Module"), "fieldname": "module", "fieldtype": "Data", "width": 150},
{"label": _("Model"), "fieldname": "model", "fieldtype": "Data", "width": 100},
{"label": _("Variant"), "fieldname": "variant", "fieldtype": "Data", "width": 100},
{"label": _("System"), "fieldname": "system", "fieldtype": "Data", "width": 100},
{"label": _("Procedure"), "fieldname": "procedure", "fieldtype": "Data", "width": 100},
{"label": _("Steps"), "fieldname": "steps", "fieldtype": "Data", "width": 100},
{"label": _("Count"), "fieldname": "count", "fieldtype": "Data", "width": 100}
]
return columns

0
smart_service/add_ons/report/release_report/__init__.py

9
smart_service/add_ons/report/release_report/release_report.js

@ -0,0 +1,9 @@
// Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Release Report"] = {
"filters": [
]
};

30
smart_service/add_ons/report/release_report/release_report.json

@ -0,0 +1,30 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2022-01-18 14:36:23.566947",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"json": "{}",
"modified": "2022-01-18 14:38:28.597494",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Release Report",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Release",
"report_name": "Release Report",
"report_type": "Script Report",
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

8
smart_service/add_ons/report/release_report/release_report.py

@ -0,0 +1,8 @@
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
# import frappe
def execute(filters=None):
columns, data = [], []
return columns, data

BIN
smart_service/apis/__pycache__/addon_api.cpython-38.pyc

Binary file not shown.

BIN
smart_service/apis/__pycache__/app_user_login.cpython-38.pyc

Binary file not shown.

BIN
smart_service/apis/__pycache__/master_api.cpython-38.pyc

Binary file not shown.

BIN
smart_service/apis/__pycache__/publish_api.cpython-38.pyc

Binary file not shown.

BIN
smart_service/apis/__pycache__/update_validation.cpython-38.pyc

Binary file not shown.

3
smart_service/apis/addon_api.py

@ -2,6 +2,7 @@ import frappe
from frappe.model.document import Document
import json
current_db_name = frappe.conf.get("db_name")
@frappe.whitelist()
def addon(args):
@ -115,7 +116,7 @@ def feedback(args,request):
i["status"] = True
else:
i["status"] = False
return api
elif args == "post_user_feedback":
request = json.loads(request)
usr_fdbk = frappe.new_doc('User Feedback')

11
smart_service/apis/app_user_login.py

@ -7,6 +7,7 @@ from frappe.utils import now
import xml.etree.ElementTree as ET
from copy import copy
current_db_name = frappe.conf.get("db_name")
@frappe.whitelist(allow_guest=True)
def app_user_validation(usr, pwd):
@ -275,7 +276,7 @@ def grant_user_access(userdata,iid):
else :
# app_device = frappe.get_doc('App Device', iid)
frappe.db.sql('''UPDATE _d6463952657fa86c.`tabApp Device` set last_logged_in= '{0}', user_name = '{2}', device_type = '{3}' where name = "{1}";'''.format(now(),iid,email,user_type_desc))
frappe.db.sql('''UPDATE {4}.`tabApp Device` set last_logged_in= '{0}', user_name = '{2}', device_type = '{3}' where name = "{1}";'''.format(now(),iid,email,user_type_desc,current_db_name))
frappe.db.commit()
app_logs = frappe.new_doc('App Log')
app_logs.user = app_user.name
@ -292,8 +293,8 @@ def grant_user_access(userdata,iid):
token = generate_keys(email)
user_details['token'] = token
# user_details['Installation ID'] = frappe.get_doc({'doctype':'App Device','device_id' : device_id}).name
lst= frappe.db.sql('''SELECT name FROM _d6463952657fa86c.`tabApp Device` where device_id = "{}";'''.format(device_id), as_list=True)
lst1= frappe.db.sql('''SELECT name FROM _d6463952657fa86c.`tabApp Users` where email_id = "{}";'''.format(email), as_list=True)
lst= frappe.db.sql('''SELECT name FROM {}.`tabApp Device` where device_id = "{}";'''.format(current_db_name,device_id), as_list=True)
lst1= frappe.db.sql('''SELECT name FROM {}.`tabApp Users` where email_id = "{}";'''.format(current_db_name,email), as_list=True)
try:
user_details['Installation ID'] = lst[-1][0]
user_details['User ID'] = lst1[-1][0]
@ -312,8 +313,8 @@ def grant_user_access(userdata,iid):
token = generate_keys(email)
user_details['token'] = token
lst= frappe.db.sql('''SELECT name FROM _d6463952657fa86c.`tabApp Device` where device_id = "{}";'''.format(device_id), as_list=True)
lst1= frappe.db.sql('''SELECT name FROM _d6463952657fa86c.`tabApp Users` where email_id = "{}";'''.format(email), as_list=True)
lst= frappe.db.sql('''SELECT name FROM {}.`tabApp Device` where device_id = "{}";'''.format(current_db_name,device_id), as_list=True)
lst1= frappe.db.sql('''SELECT name FROM {}.`tabApp Users` where email_id = "{}";'''.format(current_db_name,email), as_list=True)
try:
user_details['Installation ID'] = lst[-1][0]
user_details['User ID'] = lst1[-1][0]

12
smart_service/apis/master_api.py

@ -4,8 +4,11 @@
import frappe
from frappe.model.document import Document
import json
from frappe.utils import cstr
current_db_name = frappe.conf.get("db_name")
@frappe.whitelist()
def masters(args, LSD):
@ -37,6 +40,7 @@ def masters(args, LSD):
"vehicle",
"vehicle_segment",
"variant",
"myid as variant_id",
"active_status",
"vehicle_id",
"modified",
@ -208,13 +212,19 @@ def masters(args, LSD):
"addons_base_url":temp_api.addons_base_url,
"auto_logout_time":temp_api.auto_logout_time
}
elif args == "db":
api = frappe.conf.get("db_name")
elif args == "baseurl":
api = frappe.utils.get_url()
return api
def labels_json():
labels_lst = frappe.db.sql(
"""SELECT `tabApp Labels`.name as name,`tabApp Labels`.page_name as menu_type, `tabApp Labels`.english_label as element, `tabApp Labels`.language as lang, `tabApp Labels`.label as label, `tabApp Labels`.parent_app_labels as parent FROM _d6463952657fa86c.`tabApp Labels` order by name asc""",
"""SELECT `tabApp Labels`.name as name,`tabApp Labels`.page_name as menu_type, `tabApp Labels`.english_label as element, `tabApp Labels`.language as lang, `tabApp Labels`.label as label, `tabApp Labels`.parent_app_labels as parent FROM {0}.`tabApp Labels` order by name asc""".format(current_db_name),
as_dict=1,
)
# final = []

59
smart_service/apis/publish_api.py

@ -4,7 +4,9 @@
import frappe
from frappe.model.document import Document
import json
import frappe.utils
current_db_name = frappe.conf.get("db_name")
class Publish(Document):
pass
@ -35,9 +37,10 @@ def get_parent_map(input_list, parameter):
@frappe.whitelist()
def api_procedure(args, vehicle, language, version):
x = json_grouping(args, language)
base_url = '/home/frappe_srv_01/frappe-bench/sites/ss.hnsonline.com/public/files/'
with open(base_url + "json_files/%s-%s_v%s.json" % (vehicle, language, version), 'w') as f:
json.dump(x, f)
# base_url = '/home/frappe_srv_01/frappe-bench/sites/ss.hnsonline.com/public/files'
# with open(base_url + "json_files/%s-%s_v%s.json" % (vehicle, language, version), 'w') as f:
# json.dump(x, f)
return json.dumps(x)
@ -75,21 +78,21 @@ def json_grouping(args, language):
final_count = {}
count = 0
active_status_case = "CASE WHEN active_status = 'Active' THEN 1 ELSE 0 END AS active_status"
active_status_case = "CASE WHEN active_status = 'Active' THEN 'True' ELSE 'False' END AS active_status"
for d in variant:
variant_out = {}
# vari = frappe.db.get_list('Variant Mapping', filters={'name': d}, fields=[
# 'name', 'variant', 'vehicle', 'family_code', 'vehicle_segment', 'active_status', 'fuel', 'transmission', 'drive'])
vari = frappe.db.sql('''SELECT name,variant, vehicle,family_code,vehicle_segment,fuel,transmission,drive, %s
FROM _d6463952657fa86c.`tabVariant Mapping` WHERE name ='%s' ; ''' % (active_status_case, d), as_dict=True)
vari = frappe.db.sql('''SELECT name,variant, vehicle,family_code,vehicle_segment,fuel,transmission,drive, active_status
FROM %s.`tabVariant Mapping` WHERE name ='%s' ; ''' % (current_db_name,d), as_dict=True)
var_asset = frappe.db.sql('''SELECT category, attach_file as file, %s FROM _d6463952657fa86c.`tabVariant Mapping_Assets` where category<>'Technical Manual' and parent='%s' and language='%s';''' % (
active_status_case, d, lang['language']), as_dict=True)
var_asset = frappe.db.sql('''SELECT category, attach_file as file, %s FROM %s.`tabVariant Mapping_Assets` where category<>'Technical Manual' and parent='%s' and language='%s';''' % (
active_status_case, current_db_name, d, lang['language']), as_dict=True)
vari = vari[0]
if vari['active_status'] == 1:
vari['active_status'] = True
if vari['active_status'] == 'Active':
vari['active_status'] = True
else:
vari['active_status'] = False
@ -97,40 +100,41 @@ def json_grouping(args, language):
variant_out['Variant'] = vari
system_out = []
for i in system[d]:
sys = frappe.db.sql('''SELECT min(`tabSystem Mapping_Sub System`.idx) as systemdisplayorder,tabSystems.system_name,tabSystems.icon_file,tabSystems.myid,CASE WHEN tabSystems.active_status = 'Active' THEN 1 ELSE 0 END AS active_status
FROM _d6463952657fa86c.tabSystems
inner join _d6463952657fa86c.`tabSystem Mapping_Sub System` on tabSystems.system_name = `tabSystem Mapping_Sub System`.systems where system_name = '%s' group by system_name ;''' % i, as_dict=True)
sys = frappe.db.sql('''SELECT min(`tabSystem Mapping_Sub System`.idx) as systemdisplayorder,tabSystems.system_name,tabSystems.icon_file,tabSystems.myid,tabSystems.active_status
FROM %s.tabSystems
inner join %s.`tabSystem Mapping_Sub System` on tabSystems.system_name = `tabSystem Mapping_Sub System`.systems where system_name = '%s' group by system_name ;''' %(current_db_name,current_db_name,i), as_dict=True)
sys = sys[0]
if sys['active_status'] == 1:
if sys['active_status'] == 'Active':
sys['active_status'] = True
else:
sys['active_status'] = False
sysassets = frappe.db.sql('''SELECT idx as systemdisplayorder, system_asset FROM _d6463952657fa86c.`tabSystem Mapping_System Assets` where parent like '{0}%' and language='{1}' and systems='{2}';''' .format(
d, lang['language'], i), as_dict=True)
sysassets = frappe.db.sql('''SELECT idx as systemdisplayorder, system_asset FROM {3}.`tabSystem Mapping_System Assets` where parent like '{0}%' and language='{1}' and systems='{2}';''' .format(
d, lang['language'], i, current_db_name), as_dict=True)
sys['Assets'] = sysassets
subsystem_out = []
for j in subsystem[d][i]:
subsys = frappe.db.sql('''select `tabSystem Mapping_Sub System`.idx as subSystemdisplayorder, systems,sub_systems, symptom, component, estimated_time, rts, mat, cover_image, `tabSub Systems`.myid,
CASE WHEN `tabSystem Mapping_Sub System`.active_status = 'Active' THEN 1 ELSE 0 END AS active_status
from _d6463952657fa86c.`tabSystem Mapping_Sub System` inner join _d6463952657fa86c.`tabSub Systems` on `tabSystem Mapping_Sub System`.sub_systems = `tabSub Systems`.name
where `tabSystem Mapping_Sub System`.parent like '{0}-{3}%' and systems='{1}' and sub_systems='{2}';'''.format(d, i, j, lang['language']), as_dict=True)
`tabSystem Mapping_Sub System`.active_status
from {4}.`tabSystem Mapping_Sub System` inner join {4}.`tabSub Systems` on `tabSystem Mapping_Sub System`.sub_systems = `tabSub Systems`.name
where `tabSystem Mapping_Sub System`.parent like '{0}-{3}%' and systems='{1}' and sub_systems='{2}';'''.format(d, i, j, lang['language'], current_db_name), as_dict=True)
subsys = subsys[0]
if subsys['active_status'] == 1:
if subsys['active_status'] == 'Active':
subsys['active_status'] = True
else:
subsys['active_status'] = False
kms = frappe.db.sql(
'''SELECT kilometer as kilometer_name, idx as kilometer_IDX, applicable as kilometers_applicable FROM _d6463952657fa86c.`tabKilometer Mapping_Items` where sub_systems='%s';''' % j, as_dict=True)
'''SELECT kilometer as kilometer_name, idx as kilometer_IDX, applicable as kilometers_applicable FROM %s.`tabKilometer Mapping_Items` where sub_systems='%s' order by kilometer_IDX;''' %(current_db_name,j), as_dict=True)
subsys['Config Kilometer'] = kms
for k in docs_child:
if k['variant_mapping'] == d and k['system'] == i and k['sub_system'] == j:
proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, GROUP_CONCAT(content) as content, GROUP_CONCAT(file) as file,GROUP_CONCAT(DISTINCT idx order by idx) as display_order, idx from _d6463952657fa86c.tabProcedure_Details
where parent ='{}' group by procedure_name,step_name,content_type,content order by idx asc; '''.format(k['procedure_link']), as_dict=True)
proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, GROUP_CONCAT(content) as content, GROUP_CONCAT(file) as file,GROUP_CONCAT(DISTINCT idx order by idx) as display_order, idx from {}.tabProcedure_Details
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)
temp_data = get_parent_map(
proc_details, 'procedure_name')
@ -140,19 +144,20 @@ def json_grouping(args, language):
subsys['Procedure_details'] = k['Procedure_details']
stepcount = frappe.db.sql(
'''SELECT count(*) as Stepcount FROM _d6463952657fa86c.tabProcedure_Details where parent='{0}';'''.format(k['procedure_link']), as_dict=True)
'''SELECT count(*) as Stepcount FROM {1}.tabProcedure_Details where parent='{0}';'''.format(k['procedure_link'],current_db_name), as_dict=True)
stepcount = stepcount[0]
count = count+int(stepcount['Stepcount'])
subsystem_out.append(subsys)
sys['Subsystems'] = subsystem_out
system_out.append(sys)
variant_out['Stepcount'] = count
variant_out['StepCount'] = count
variant_out['Variant']['Systems'] = system_out
final.append(variant_out)
# final_count['StepCount'] = count
# final.append(final_count)
frappe.db.sql(""" UPDATE _d6463952657fa86c.tabPublish SET publish_status = '%s' where name = '%s' """ % (
'Published', args))
frappe.db.sql(""" UPDATE %s.tabPublish SET publish_status = '%s' where name = '%s' """ % (
current_db_name,'Published', args))
frappe.db.commit()
return final

4
smart_service/apis/transaction_api.py

@ -2,6 +2,8 @@ import frappe
from frappe.model.document import Document
import json
current_db_name = frappe.conf.get("db_name")
@frappe.whitelist()
def get_technical_manual(args):
# request = json.loads(args)
@ -13,7 +15,7 @@ def get_technical_manual(args):
# key_dict = frappe.db.sql('''SELECT name as variantkey, vehicle, variant, fuel, transmission, drive FROM _d6463952657fa86c.`tabVariant Mapping` where vehicle='{0}' and variant='{1}' and fuel='{2}' and transmission='{3}' and drive='{4}';'''.format(vehicle,variant,fuel,transmission,drive), as_dict=True)
# key_dict=key_dict[0]
# variantkey=key_dict['variantkey']
manual_out=frappe.db.sql('''SELECT parent as variant, language, attach_file as file, active_status FROM _d6463952657fa86c.`tabVariant Mapping_Assets` where parent='{0}' and category='Technical Manual' and parentfield = 'assets';'''.format(args), as_dict=True)
manual_out=frappe.db.sql('''SELECT parent as variant, language, attach_file as file, active_status FROM {1}.`tabVariant Mapping_Assets` where parent='{0}' and category='Technical Manual' and parentfield = 'assets';'''.format(args,current_db_name), as_dict=True)
for i in manual_out:
if i["active_status"] == "Active":
i["active_status"] = True

55
smart_service/apis/update_validation.py

@ -3,6 +3,7 @@ from frappe.model.document import Document
import json
import os
current_db_name = frappe.conf.get("db_name")
@frappe.whitelist()
def check_all_vehicle_updates(vehicle_list):
@ -13,20 +14,20 @@ def check_all_vehicle_updates(vehicle_list):
iid = v_list['InstallationId']
vehicle_data = v_list['VehicleReqList']
publish_type = frappe.db.sql(
'''SELECT publish_type FROM _d6463952657fa86c.`tabApp Device` where name='{}';'''.format(iid), as_list=True)
'''SELECT publish_type FROM {}.`tabApp Device` where name='{}';'''.format(current_db_name,iid), as_list=True)
if publish_type[0][0] != None:
for v in vehicle_data:
v_id = v['Vehicle']
current_version = float(v['CurrentVersion'])
data1 = frappe.db.sql('''SELECT name,max(version) as version,language FROM _d6463952657fa86c.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' order by version ASC;'''.format(v_id, lang, publish_type[0][0]), as_dict=True)
data1 = frappe.db.sql('''SELECT name,max(version) as version,language FROM {}.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' order by version ASC;'''.format(current_db_name,v_id, lang, publish_type[0][0]), as_dict=True)
if data1[0]['version'] != None:
if current_version == float(data1[0]['version']):
data1[0]['IsUpdateAvailable'] = "false"
Vehicle_req_list.append(data1)
else:
data = frappe.db.sql('''SELECT name,CAST(version AS DECIMAL(10,2)) as version,language FROM _d6463952657fa86c.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' and version > '{}' order by version ASC;'''.format(v_id, lang, publish_type[0][0], current_version), as_dict=True)
data = frappe.db.sql('''SELECT name,CAST(version AS DECIMAL(10,2)) as version,language FROM {}.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' and version > '{}' order by version ASC;'''.format(current_db_name,v_id, lang, publish_type[0][0], current_version), as_dict=True)
data_append = []
for d in data:
d['IsUpdateAvailable'] = 'true'
@ -47,7 +48,6 @@ def check_all_vehicle_updates(vehicle_list):
@frappe.whitelist()
def check_vehicle_update(vehicle_list):
base_url = '/home/frappe_srv_01/frappe-bench/sites/ss.hnsonline.com/public/files/'
Vehicle_req_list = []
response = {}
v_list = json.loads(vehicle_list)
@ -55,14 +55,14 @@ def check_vehicle_update(vehicle_list):
iid = v_list['InstallationId']
vehicle_data = v_list['VehicleReqList']
publish_type = frappe.db.sql(
'''SELECT publish_type FROM _d6463952657fa86c.`tabApp Device` where name='{}';'''.format(iid), as_list=True)
'''SELECT publish_type FROM {}.`tabApp Device` where name='{}';'''.format(current_db_name,iid), as_list=True)
if publish_type[0][0] != None:
for v in vehicle_data:
l_id = v['LanguageID']
current_version = float(v['CurrentVersion'])
data1 = frappe.db.sql('''SELECT name,max(version) as version,language FROM _d6463952657fa86c.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' order by version ASC;'''.format(vehi, l_id, publish_type[0][0]), as_dict=True)
data1 = frappe.db.sql('''SELECT name,max(version) as version,language FROM {}.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' order by version ASC;'''.format(current_db_name,vehi, l_id, publish_type[0][0]), as_dict=True)
if data1[0]['name'] != None:
if data1[0]['version'] != None:
@ -72,11 +72,11 @@ def check_vehicle_update(vehicle_list):
else:
if publish_type[0][0] == 'Internal':
data = frappe.db.sql('''SELECT name,CAST(version AS DECIMAL(10,2)) as version,language FROM _d6463952657fa86c.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' and version > '{}' order by version ASC;'''.format(vehi, l_id, publish_type[0][0], current_version), as_dict=True)
data = frappe.db.sql('''SELECT name,CAST(version AS DECIMAL(10,2)) as version,language FROM {}.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' and version > '{}' order by version ASC;'''.format(current_db_name,vehi, l_id, publish_type[0][0], current_version), as_dict=True)
else:
data = frappe.db.sql('''SELECT name,version,language FROM _d6463952657fa86c.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' and version > '{}' order by version ASC;'''.format(vehi, l_id, publish_type[0][0], current_version), as_dict=True)
data = frappe.db.sql('''SELECT name,version,language FROM {}.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
and publish_type='{}' and vehicle_status='Active' and version > '{}' order by version ASC;'''.format(current_db_name,vehi, l_id, publish_type[0][0], current_version), as_dict=True)
list1 = []
dict1 = {}
@ -95,23 +95,24 @@ def check_vehicle_update(vehicle_list):
f_name = "/files/json_files/temp/%s-%s_%s.json" % (
iid, vehi, l_id)
with open(base_url+f_name, 'w') as outfile:
outfile.write(json.dumps(dict1))
# with open(base_url+f_name, 'w') as outfile:
# outfile.write(json.dumps(dict1))
res = {}
res['Name'] = '%s-%s_%s' % (iid, vehi, l_id)
res['Language'] = l_id
res['IsUpdateAvailable'] = 'true'
res['CurrentVersion'] = float(current_version)
res['Version'] = float(data1[0]['version'])
res['JsonURL'] = f_name
# res = {}
# res['Name'] = '%s-%s_%s' % (iid, vehi, l_id)
# res['Language'] = l_id
# res['IsUpdateAvailable'] = 'true'
# res['CurrentVersion'] = float(current_version)
# res['Version'] = float(data1[0]['version'])
# res['JsonURL'] = f_name
res = {'Name': '%s-%s_%s' % (iid, vehi, l_id), 'Language': l_id, 'IsUpdateAvailable': 'true',
'CurrentVersion': float(current_version), 'Version': float(data1[0]['version']),
'JsonURL': f_name}
Vehicle_req_list.append(res)
else:
res = {}
res['Language'] = l_id
res['IsUpdateAvailable'] = 'false'
res['CurrentVersion'] = float(current_version)
Vehicle_req_list.append(res)
# res = {'Language': l_id, 'IsUpdateAvailable': 'false', 'CurrentVersion': float(current_version)}
Vehicle_req_list.append({'Language': l_id, 'IsUpdateAvailable': 'false', 'CurrentVersion': float(current_version)})
response['Vehicle'] = vehi
response['VehicleReqList'] = Vehicle_req_list

870
smart_service/json_files/Thar-en -2022-01-10 15:02:15.309338'.json

@ -1,870 +0,0 @@
[
{
"Variant": {
"name": "Thar.AX-0432",
"variant": "Thar.AX",
"vehicle": "Thar",
"family_code": "J08",
"vehicle_segment": "Personal",
"fuel": "DSL",
"transmission": "MT",
"drive": "4WD",
"active_status": true,
"Assets": [],
"Systems": [
{
"systemdisplayorder": 4,
"system_name": "Exhaust & Emission Control",
"icon_file": null,
"myid": 1001,
"active_status": true,
"Assets": [
{
"systemdisplayorder": 2,
"system_asset": "/private/files/ECU IP & OP (D)_v2.mp4"
}
],
"Subsystems": [
{
"subSystemdisplayorder": 4,
"systems": "Exhaust & Emission Control",
"sub_systems": "Precautions & Handling Of Dosing Module (DM) & Supply Module SM",
"symptom": 0,
"component": 0,
"estimated_time": null,
"rts": null,
"mat": null,
"cover_image": null,
"active_status": true,
"Config Kilometer": [],
"procedure_status": "Publish Ready",
"procedure_link": "Thar.AX-0432-Precautions & Handling Of Dosing Module (DM) & Supply Module SM-en",
"Procedure_details": [
{
"procedure_name": "Overview",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": "",
"file": "/files/Rear Fog Lamp.jpg",
"display_order": "1"
},
{
"step_name": "Step-1",
"content_type": "Heading",
"content": "<b>Do\u2019s &amp; Don\u2019ts</b>",
"file": null,
"display_order": "2"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "<ul><li>Do not hold the Supply Module while carry DEF tank.</li></ul>",
"file": null,
"display_order": "3"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": "",
"file": "/files/W4A080026.jpg",
"display_order": "4"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "<ul><li>Do not handle Supply Module using connectors, complete housing to be held to avoid any type of damages.</li> </ul>",
"file": null,
"display_order": "5"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": "",
"file": "/files/W4A130187.jpg",
"display_order": "6"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "<ul><li>Handle Dosing Module using housing and not on connectors to avoid any type of damages.</li></ul>",
"file": null,
"display_order": "7"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ul><li>Structural changes of the Dosing Module is not permitted.</li><li>Dismounting of dosing valve out of the cooling body is not allowed.</li></ul>",
"file": null,
"display_order": "8"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ol><li><b>Avoid painting or application of other coatings on Dosing Module (DM) &amp; Supply Module (SM) to ensure lifetime &amp; functionality.</b></li><li><b>Always remove (manually) protection caps of DM &amp; SM just before assembly of its mating pipes/cables, to avoid contamination of the system.</b></li><li><b>Only use recommended tools for remove &amp; Installation of DM &amp; SM. After removing, cover the openings with protective caps to prevent the entry of contaminants.</b></li><li><b>The entry of contaminants in the interfaces of the DM must be prevented during Installation &amp; removing of DM.</b></li></ol>",
"file": null,
"display_order": "9"
},
{
"step_name": "Step-5",
"content_type": "Heading",
"content": "<b>Storage Guidelines<b></b></b>",
"file": null,
"display_order": "10"
},
{
"step_name": "Step-5",
"content_type": "Description",
"content": "<ol><li>Dosing Module (DM) &amp; Supply Module (SM) should not be handled as bulk goods, as it can damage the parts. If a part falls down, it must be scrapped, even if it looks visually ok, to avoid any latent damages leading emission issues.</li> <li>Parts have to be stored in original M&amp;M packaging.</li> <li>Parts needs to be protected against rain, snow, heat sources and dust.</li> <li>Max. storage period of DM &amp; SM should be not more than 4 years.</li> <li>Avoid any damages to Supply Module while storing DEF tank.</li></ol>",
"file": null,
"display_order": "11"
}
]
}
]
}
]
},
{
"systemdisplayorder": 1,
"system_name": "Air Intake",
"icon_file": null,
"myid": 1000,
"active_status": true,
"Assets": [
{
"systemdisplayorder": 1,
"system_asset": "/private/files/CAN Communication (D)_v3.mp4"
}
],
"Subsystems": [
{
"subSystemdisplayorder": 1,
"systems": "Air Intake",
"sub_systems": "Air Filter Element Clean",
"symptom": 0,
"component": 0,
"estimated_time": null,
"rts": null,
"mat": null,
"cover_image": null,
"active_status": true,
"Config Kilometer": [],
"procedure_status": "Publish Ready",
"procedure_link": "Thar.AX-0432-Air Filter Element Clean-en",
"Procedure_details": [
{
"procedure_name": "Overview",
"steps": [
{
"step_name": "Overview",
"content_type": "File",
"content": null,
"file": "/files/ESP OFF.jpg,/files/W4A160067.jpg,/files/W4A130334.jpg",
"display_order": "1,2,3"
},
{
"step_name": "Overview",
"content_type": "Description",
"content": "The air cleaner element is Non woven +Pleated Media type (Dry Type). Filtration happens in two stages. Coarser particles are filtered in first stage by foam media and fine particles are filtered by Paper media in second stage. The dust and other fine particles which are sucked inside along with air gets trapped in the air cleaner while passing through the filter element.",
"file": null,
"display_order": "4"
},
{
"step_name": "Overview",
"content_type": "Notice",
"content": "Don\u2019t tap or hit the filter element.",
"file": null,
"display_order": "5"
},
{
"step_name": "Preliminary Activities",
"content_type": "Description",
"content": "Park the vehicle on flat work bay.Open the bonnet and lock it in open position using bonnet stay rod.",
"file": null,
"display_order": "6"
},
{
"step_name": "Tools Required",
"content_type": "File",
"content": null,
"file": "/files/W4A120270.jpg",
"display_order": "7"
}
]
},
{
"procedure_name": "Removal",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": null,
"file": "/files/Hill Hold.jpg",
"display_order": "8"
},
{
"step_name": "Step-1",
"content_type": "Caution",
"content": "The air filter element should be inspected and replaced from time to time, when driving under the following conditions:Unpaved road.Dusty air-polluted road.Long-term driving in rainy weather.",
"file": null,
"display_order": "9"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "Using a 5 mm allen key, Unscrew air cleaner top housing mounting allen screws and lift the top housing.",
"file": null,
"display_order": "10"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": null,
"file": "/files/W4A150059.jpg",
"display_order": "11"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "Gently take out the air cleaner element from the housing.",
"file": null,
"display_order": "12"
}
]
},
{
"procedure_name": "Cleaning",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": null,
"file": "/files/W4A020124.jpg",
"display_order": "13"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "Clean the inner side of the air cleaner housing using a lint free cloth.",
"file": null,
"display_order": "14"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": null,
"file": "/files/W4A020013.jpg,/files/W4A020011.jpg,/files/W4A020012.jpg",
"display_order": "15,16,17"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "Blow the compressed air from the top clean side of filter element.",
"file": null,
"display_order": "18"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "Blow the compress air from the top clean side of filter element (From Paper side).Do not blow the air from bottom dirty side (Foam side).While cleaning, ensure the air pressure should be less than 2 bar.",
"file": null,
"display_order": "19"
}
]
},
{
"procedure_name": "Installation",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": null,
"file": "/files/W4A020124.jpg",
"display_order": "20"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "Clean the inner side of the air cleaner housing using a lint free cloth.",
"file": null,
"display_order": "21"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": null,
"file": "/files/W4A020017.jpg",
"display_order": "22"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "Gently insert the air cleaner element inside the air cleaner housing.",
"file": null,
"display_order": "23"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "During Installation ensure to keep foam side of the filter element in the bottom side.Ensure dust should not fall inside the clean hose area while fitting.Ensure dust should not fall inside the clean hose area while fitting.",
"file": null,
"display_order": "24"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "Always use recommended genuine air filter element.Do not tap or hit the new filter element.",
"file": null,
"display_order": "25"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": null,
"file": "/files/W4A020123.jpg",
"display_order": "26"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "Refit the air cleaner top housing and install the mounting allen screws.",
"file": null,
"display_order": "27"
},
{
"step_name": "Step-3",
"content_type": "Torque Value",
"content": "Torque : 10 Nm",
"file": null,
"display_order": "28"
}
]
}
]
}
]
},
{
"systemdisplayorder": 2,
"system_name": "Fuel System",
"icon_file": null,
"myid": 1002,
"active_status": true,
"Assets": [
{
"systemdisplayorder": 3,
"system_asset": "/private/files/ECU IP & OP (D)_v2.mp4"
}
],
"Subsystems": [
{
"subSystemdisplayorder": 6,
"systems": "Fuel System",
"sub_systems": "Fuel Filter Element - Replace",
"symptom": 0,
"component": 0,
"estimated_time": null,
"rts": null,
"mat": null,
"cover_image": null,
"active_status": true,
"Config Kilometer": [],
"procedure_status": "Publish Ready",
"procedure_link": "Thar.AX-0432-Fuel Filter Element - Replace-en",
"Procedure_details": [
{
"procedure_name": "Overview",
"steps": [
{
"step_name": "Overview",
"content_type": "File",
"content": ",,",
"file": "/files/W4A120027.jpg,/files/W4A150068.jpg,/files/W4A190115.jpg",
"display_order": "1,2,3"
},
{
"step_name": "Overview",
"content_type": "Description",
"content": "<ul><li>The fuel filter filters impurities that may be present in the fuel. The fuel system operates under high pressure which makes it absolutely essential for the fuel to be dust free and moisture free. The fuel filter also has the water separator which filters the moisture that may have crept into the fuel. The high pressure pump in the fuel system operates at high speeds and fine clearance which needs the diesel to be dust free and also be free of moisture at the same time. Since the diesel itself lubricates the PF Pump, If water content is present in fuel, the fuel looses its lubrication property and thus PF Pump and injectors will get damaged. Also the moisture content may lead to formation of rust on the pump elements. This makes it advisable not to use diesel with additives which may cause damage to the PF Pump.</li></ul>",
"file": "",
"display_order": "4"
},
{
"step_name": "Preliminary Activities",
"content_type": "Description",
"content": "<ol><li>Park the vehicle on level work bay</li><li>Open the bonnet and lock it in open position using bonnet stay rod.</li></ol>",
"file": "",
"display_order": "5"
},
{
"step_name": "Tools Required",
"content_type": "File",
"content": "",
"file": "/files/W4A020122.jpg",
"display_order": "6"
}
]
},
{
"procedure_name": "Removal",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": "",
"file": "/files/W4A150076.jpg",
"display_order": "7"
},
{
"step_name": "Step-1",
"content_type": "Warning",
"content": "<ul><li><b>Ensure that the fuel is drained from filter assembly before the fuel filter element is removed.</b></li><li><b>Do not hold fuel filter body part and avoid damage to the fuel filter body.</b></li></ul>",
"file": "",
"display_order": "8"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "<ul><li>Press the lock and disconnect the electrical connector from the fuel filter.</li></ul>",
"file": "",
"display_order": "9"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": "",
"file": "/files/W4A200104.jpg",
"display_order": "10"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "<ul><li>Disconnect the fuel supply pipe by disconnecting the quick coupler.</li></ul>",
"file": "",
"display_order": "11"
},
{
"step_name": "Step-2",
"content_type": "Notice",
"content": "<ul><li><b>All are quick fix connectors, press gently and remove it carefully; avoid seal damages.</b></li></ul>",
"file": "",
"display_order": "12"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": "",
"file": "/files/W4A130055.jpg",
"display_order": "13"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "<ul><li>Disconnect the fuel return pipe by disconnecting the quick coupler.</li></ul>",
"file": "",
"display_order": "14"
},
{
"step_name": "Step-3",
"content_type": "Notice",
"content": "<ul><li><b>All are quick fix connectors, press gently and remove it carefully; avoid seal damages.</b></li></ul>",
"file": "",
"display_order": "15"
},
{
"step_name": "Step-4",
"content_type": "File",
"content": "",
"file": "/files/W4A130123.jpg",
"display_order": "16"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ul><li>Using a 12 mm socket spanner, loosen and remove the fuel filter assembly mounting bolts.</li></ul>",
"file": "",
"display_order": "17"
},
{
"step_name": "Step-5",
"content_type": "File",
"content": ",",
"file": "/files/W4A100097.jpg,/files/W4A150229.jpg",
"display_order": "18,19"
},
{
"step_name": "Step-5",
"content_type": "Description",
"content": "<ul><li>Remove the filter from the vehicle.</li></ul>",
"file": "",
"display_order": "20"
},
{
"step_name": "Step-6",
"content_type": "File",
"content": "",
"file": "/files/W4A140041.jpg",
"display_order": "21"
},
{
"step_name": "Step-6",
"content_type": "Description",
"content": "<ul><li>Use two approx. 2\u0096 3 inches long size \u00a0M12 bolts and nuts to hold fuel filter \u00a0assembly in a bench vice as shown in illustration.</li></ul>",
"file": "",
"display_order": "22"
},
{
"step_name": "Step-7",
"content_type": "File",
"content": "",
"file": "/files/W4A050117.jpg",
"display_order": "23"
},
{
"step_name": "Step-7",
"content_type": "Description",
"content": "<ul><li>Using a 36 mm ring/socket spanner, rotate the fuel filter bottom cover in anticlockwise direction and loosen.</li></ul>",
"file": "",
"display_order": "24"
},
{
"step_name": "Step-8",
"content_type": "File",
"content": "",
"file": "/files/W4A120130.jpg",
"display_order": "25"
},
{
"step_name": "Step-8",
"content_type": "Description",
"content": "<ul><li>Remove the fuel filter body.</li></ul>",
"file": "",
"display_order": "26"
},
{
"step_name": "Step-9",
"content_type": "File",
"content": "",
"file": "/files/W4A150065.jpg",
"display_order": "27"
},
{
"step_name": "Step-9",
"content_type": "Description",
"content": "<ul><li>Take out the filter element from the fuel filter housing.</li></ul>",
"file": "",
"display_order": "28"
},
{
"step_name": "Step-10",
"content_type": "File",
"content": "",
"file": "/files/W4A120204.jpg",
"display_order": "29"
},
{
"step_name": "Step-10",
"content_type": "Description",
"content": "<ul><li>Remove the O-ring from the fuel filter housing.</li></ul>",
"file": "",
"display_order": "30"
}
]
},
{
"procedure_name": "Installation",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": "",
"file": "/files/W4A120302.jpg",
"display_order": "31"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "<ul><li>Assemble the new O-ring back on to filter housing, which is supplied along with new filter element. Ensure little oil is smeared on to the surface of O-ring before assembly on to head.</li></ul>",
"file": "",
"display_order": "32"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": "",
"file": "/files/W4A040162.jpg",
"display_order": "33"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "<ul><li>Insert the filter element correctly into housing as shown in illustration.</li></ul>",
"file": "",
"display_order": "34"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "<ul><li><b>Press the filter element by gentle push into the head.</b></li></ul>",
"file": "",
"display_order": "35"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": "",
"file": "/files/W4A120103.jpg",
"display_order": "36"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "<ul><li>Refit the fuel filter element into the fuel filter housing.</li></ul>",
"file": "",
"display_order": "37"
},
{
"step_name": "Step-3",
"content_type": "Caution",
"content": "<ul><li><b>Assemble filter element on to head in the direction shown. Ensure open end of filter element goes inside first.</b></li></ul>",
"file": "",
"display_order": "38"
},
{
"step_name": "Step-4",
"content_type": "File",
"content": "",
"file": "/files/W4A130205.jpg",
"display_order": "39"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ul><li>Tighten the filter body using 36 mm size \u00a0socket spanner to specified torque value.</li></ul>",
"file": "",
"display_order": "40"
},
{
"step_name": "Step-4",
"content_type": "Caution",
"content": "<ul><li><b>Do not over tighten beyond 25\u00b15 Nm. This may cause damage to the bowl and Head. </b></li><li><b>Is it recommended to tight the fuel filter using torque wrench. </b></li><b> </b></ul>",
"file": "",
"display_order": "41"
},
{
"step_name": "Step-5",
"content_type": "File",
"content": "",
"file": "/files/W4A140217.jpg",
"display_order": "42"
},
{
"step_name": "Step-5",
"content_type": "Description",
"content": "<ul><li>Remove the filter assembly from the wise.</li></ul>",
"file": "",
"display_order": "43"
},
{
"step_name": "Step-6",
"content_type": "File",
"content": "",
"file": "/files/W4A150159.jpg",
"display_order": "44"
},
{
"step_name": "Step-6",
"content_type": "Description",
"content": "<ul><li> Refit the fuel filter assembly and install the mounting bolts.</li></ul>",
"file": "",
"display_order": "45"
},
{
"step_name": "Step-6",
"content_type": "Torque Value",
"content": "<b>Torque : 25 \u00b1 5 Nm</b>",
"file": "",
"display_order": "46"
},
{
"step_name": "Step-7",
"content_type": "File",
"content": "",
"file": "/files/W4A170025_0000346813.jpg",
"display_order": "47"
},
{
"step_name": "Step-7",
"content_type": "Description",
"content": "<ul><li>Reconnect the fuel filter fuel return line quick coupler.</li></ul>",
"file": "",
"display_order": "48"
},
{
"step_name": "Step-7",
"content_type": "Notice",
"content": "<ul><li><b>All are quick fix connectors, press gently and refit it carefully; avoid seal damages.</b> </li><li><b>Check and ensure proper fitment of \u00a0fuel lines, any leakage can lead to fire.</b></li> </ul>",
"file": "",
"display_order": "49"
},
{
"step_name": "Step-8",
"content_type": "File",
"content": "",
"file": "/files/W4A150260.jpg",
"display_order": "50"
},
{
"step_name": "Step-8",
"content_type": "Description",
"content": "<ul><li>Reconnect the fuel filter fuel supply pipe quick coupler.</li></ul>",
"file": "",
"display_order": "51"
},
{
"step_name": "Step-8",
"content_type": "Notice",
"content": "<ul><li><b>All are quick fix connectors, press gently and refit it carefully; avoid seal damages. </b></li><li><b>Check and ensure proper fitment of fuel lines, any leakage can lead to fire.</b> </li> </ul>",
"file": "",
"display_order": "52"
},
{
"step_name": "Step-9",
"content_type": "File",
"content": "",
"file": "",
"display_order": "53"
},
{
"step_name": "Step-9",
"content_type": "Description",
"content": "<ul><li>Reconnect the fuel filter electrical connector.</li></ul>",
"file": "",
"display_order": "54"
},
{
"step_name": "Step-9",
"content_type": "Caution",
"content": "<ul><li><b>Always use recommended filter element only.</b></li><li><b>Before removing the fuel filter, open the fuel tank cap to release the pressure from the tank and fuel lines. </b></li><li><b>Fuel filter cartridge needs to be replaced earlier in case of repeat water in fuel warning in cluster even after the water is drained from the system. </b></li></ul>",
"file": "",
"display_order": "55"
}
]
}
]
},
{
"subSystemdisplayorder": 5,
"systems": "Fuel System",
"sub_systems": "Water In Fuel Filter - Clean",
"symptom": 0,
"component": 0,
"estimated_time": null,
"rts": null,
"mat": null,
"cover_image": null,
"active_status": true,
"Config Kilometer": [],
"procedure_status": "Publish Ready",
"procedure_link": "Thar.AX-0432-Water In Fuel Filter - Clean-en",
"Procedure_details": [
{
"procedure_name": "Overview",
"steps": [
{
"step_name": "Overview",
"content_type": "File",
"content": ",",
"file": "/files/W4A130307.jpg,/files/W4A170267.jpg",
"display_order": "1,2"
},
{
"step_name": "Preliminary Activities",
"content_type": "Description",
"content": "<ol><li>Park the vehicle on level work bay.</li><li>Open the bonnet and lock it in open position using bonnet stay rod.</li></ol>",
"file": "",
"display_order": "3"
},
{
"step_name": "Tools Required",
"content_type": "File",
"content": "",
"file": "/files/W4A090056.jpg",
"display_order": "4"
}
]
},
{
"procedure_name": "Sediment Draining",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": "",
"file": "/files/W4A120024.jpg",
"display_order": "5"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "<ul><li>Connect the transparent pipe to the drain \u00a0plug outlet of the fuel filter assembly</li></ul>",
"file": "",
"display_order": "6"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": "",
"file": "/files/W4A100016.jpg",
"display_order": "7"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "<ul><li>Using a Nose plier, rotate drain plug anticlockwise till the water starts flowing from the tube.</li></ul>",
"file": "",
"display_order": "8"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "<ul><li><b>Drain plug requires hand tight only; do not use any tool and avoid over tightening.</b></li><li><b>Do not over tight the drain plug</b></li></ul>",
"file": "",
"display_order": "9"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": "",
"file": "/files/W4A100061.jpg",
"display_order": "10"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "<ul><li>Rotate drain plug in clockwise directio \u00a0to stop the flow as soon as water gets over and fuel flow starts. Tighten the drain plug.</li></ul>",
"file": "",
"display_order": "11"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ul><li>Start the engine and check for any leaks.</li></ul>",
"file": "",
"display_order": "12"
}
]
}
]
}
]
}
]
}
},
{
"StepCount": 106
}
]

870
smart_service/json_files/procedurePublish.json

@ -1,870 +0,0 @@
[
{
"Variant": {
"name": "Thar.AX-0432",
"variant": "Thar.AX",
"vehicle": "Thar",
"family_code": "J08",
"vehicle_segment": "Personal",
"fuel": "DSL",
"transmission": "MT",
"drive": "4WD",
"active_status": true,
"Assets": [],
"Systems": [
{
"systemdisplayorder": 2,
"system_name": "Fuel System",
"icon_file": null,
"myid": 1002,
"active_status": true,
"Assets": [
{
"systemdisplayorder": 3,
"system_asset": "/private/files/ECU IP & OP (D)_v2.mp4"
}
],
"Subsystems": [
{
"subSystemdisplayorder": 6,
"systems": "Fuel System",
"sub_systems": "Fuel Filter Element - Replace",
"symptom": 0,
"component": 0,
"estimated_time": null,
"rts": null,
"mat": null,
"cover_image": null,
"active_status": true,
"Config Kilometer": [],
"procedure_status": "Publish Ready",
"procedure_link": "Thar.AX-0432-Fuel Filter Element - Replace-en",
"Procedure_details": [
{
"procedure_name": "Overview",
"steps": [
{
"step_name": "Overview",
"content_type": "File",
"content": ",,",
"file": "/files/W4A120027.jpg,/files/W4A150068.jpg,/files/W4A190115.jpg",
"display_order": "1,2,3"
},
{
"step_name": "Overview",
"content_type": "Description",
"content": "<ul><li>The fuel filter filters impurities that may be present in the fuel. The fuel system operates under high pressure which makes it absolutely essential for the fuel to be dust free and moisture free. The fuel filter also has the water separator which filters the moisture that may have crept into the fuel. The high pressure pump in the fuel system operates at high speeds and fine clearance which needs the diesel to be dust free and also be free of moisture at the same time. Since the diesel itself lubricates the PF Pump, If water content is present in fuel, the fuel looses its lubrication property and thus PF Pump and injectors will get damaged. Also the moisture content may lead to formation of rust on the pump elements. This makes it advisable not to use diesel with additives which may cause damage to the PF Pump.</li></ul>",
"file": "",
"display_order": "4"
},
{
"step_name": "Preliminary Activities",
"content_type": "Description",
"content": "<ol><li>Park the vehicle on level work bay</li><li>Open the bonnet and lock it in open position using bonnet stay rod.</li></ol>",
"file": "",
"display_order": "5"
},
{
"step_name": "Tools Required",
"content_type": "File",
"content": "",
"file": "/files/W4A020122.jpg",
"display_order": "6"
}
]
},
{
"procedure_name": "Removal",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": "",
"file": "/files/W4A150076.jpg",
"display_order": "7"
},
{
"step_name": "Step-1",
"content_type": "Warning",
"content": "<ul><li><b>Ensure that the fuel is drained from filter assembly before the fuel filter element is removed.</b></li><li><b>Do not hold fuel filter body part and avoid damage to the fuel filter body.</b></li></ul>",
"file": "",
"display_order": "8"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "<ul><li>Press the lock and disconnect the electrical connector from the fuel filter.</li></ul>",
"file": "",
"display_order": "9"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": "",
"file": "/files/W4A200104.jpg",
"display_order": "10"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "<ul><li>Disconnect the fuel supply pipe by disconnecting the quick coupler.</li></ul>",
"file": "",
"display_order": "11"
},
{
"step_name": "Step-2",
"content_type": "Notice",
"content": "<ul><li><b>All are quick fix connectors, press gently and remove it carefully; avoid seal damages.</b></li></ul>",
"file": "",
"display_order": "12"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": "",
"file": "/files/W4A130055.jpg",
"display_order": "13"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "<ul><li>Disconnect the fuel return pipe by disconnecting the quick coupler.</li></ul>",
"file": "",
"display_order": "14"
},
{
"step_name": "Step-3",
"content_type": "Notice",
"content": "<ul><li><b>All are quick fix connectors, press gently and remove it carefully; avoid seal damages.</b></li></ul>",
"file": "",
"display_order": "15"
},
{
"step_name": "Step-4",
"content_type": "File",
"content": "",
"file": "/files/W4A130123.jpg",
"display_order": "16"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ul><li>Using a 12 mm socket spanner, loosen and remove the fuel filter assembly mounting bolts.</li></ul>",
"file": "",
"display_order": "17"
},
{
"step_name": "Step-5",
"content_type": "File",
"content": ",",
"file": "/files/W4A100097.jpg,/files/W4A150229.jpg",
"display_order": "18,19"
},
{
"step_name": "Step-5",
"content_type": "Description",
"content": "<ul><li>Remove the filter from the vehicle.</li></ul>",
"file": "",
"display_order": "20"
},
{
"step_name": "Step-6",
"content_type": "File",
"content": "",
"file": "/files/W4A140041.jpg",
"display_order": "21"
},
{
"step_name": "Step-6",
"content_type": "Description",
"content": "<ul><li>Use two approx. 2\u0096 3 inches long size \u00a0M12 bolts and nuts to hold fuel filter \u00a0assembly in a bench vice as shown in illustration.</li></ul>",
"file": "",
"display_order": "22"
},
{
"step_name": "Step-7",
"content_type": "File",
"content": "",
"file": "/files/W4A050117.jpg",
"display_order": "23"
},
{
"step_name": "Step-7",
"content_type": "Description",
"content": "<ul><li>Using a 36 mm ring/socket spanner, rotate the fuel filter bottom cover in anticlockwise direction and loosen.</li></ul>",
"file": "",
"display_order": "24"
},
{
"step_name": "Step-8",
"content_type": "File",
"content": "",
"file": "/files/W4A120130.jpg",
"display_order": "25"
},
{
"step_name": "Step-8",
"content_type": "Description",
"content": "<ul><li>Remove the fuel filter body.</li></ul>",
"file": "",
"display_order": "26"
},
{
"step_name": "Step-9",
"content_type": "File",
"content": "",
"file": "/files/W4A150065.jpg",
"display_order": "27"
},
{
"step_name": "Step-9",
"content_type": "Description",
"content": "<ul><li>Take out the filter element from the fuel filter housing.</li></ul>",
"file": "",
"display_order": "28"
},
{
"step_name": "Step-10",
"content_type": "File",
"content": "",
"file": "/files/W4A120204.jpg",
"display_order": "29"
},
{
"step_name": "Step-10",
"content_type": "Description",
"content": "<ul><li>Remove the O-ring from the fuel filter housing.</li></ul>",
"file": "",
"display_order": "30"
}
]
},
{
"procedure_name": "Installation",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": "",
"file": "/files/W4A120302.jpg",
"display_order": "31"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "<ul><li>Assemble the new O-ring back on to filter housing, which is supplied along with new filter element. Ensure little oil is smeared on to the surface of O-ring before assembly on to head.</li></ul>",
"file": "",
"display_order": "32"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": "",
"file": "/files/W4A040162.jpg",
"display_order": "33"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "<ul><li>Insert the filter element correctly into housing as shown in illustration.</li></ul>",
"file": "",
"display_order": "34"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "<ul><li><b>Press the filter element by gentle push into the head.</b></li></ul>",
"file": "",
"display_order": "35"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": "",
"file": "/files/W4A120103.jpg",
"display_order": "36"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "<ul><li>Refit the fuel filter element into the fuel filter housing.</li></ul>",
"file": "",
"display_order": "37"
},
{
"step_name": "Step-3",
"content_type": "Caution",
"content": "<ul><li><b>Assemble filter element on to head in the direction shown. Ensure open end of filter element goes inside first.</b></li></ul>",
"file": "",
"display_order": "38"
},
{
"step_name": "Step-4",
"content_type": "File",
"content": "",
"file": "/files/W4A130205.jpg",
"display_order": "39"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ul><li>Tighten the filter body using 36 mm size \u00a0socket spanner to specified torque value.</li></ul>",
"file": "",
"display_order": "40"
},
{
"step_name": "Step-4",
"content_type": "Caution",
"content": "<ul><li><b>Do not over tighten beyond 25\u00b15 Nm. This may cause damage to the bowl and Head. </b></li><li><b>Is it recommended to tight the fuel filter using torque wrench. </b></li><b> </b></ul>",
"file": "",
"display_order": "41"
},
{
"step_name": "Step-5",
"content_type": "File",
"content": "",
"file": "/files/W4A140217.jpg",
"display_order": "42"
},
{
"step_name": "Step-5",
"content_type": "Description",
"content": "<ul><li>Remove the filter assembly from the wise.</li></ul>",
"file": "",
"display_order": "43"
},
{
"step_name": "Step-6",
"content_type": "File",
"content": "",
"file": "/files/W4A150159.jpg",
"display_order": "44"
},
{
"step_name": "Step-6",
"content_type": "Description",
"content": "<ul><li> Refit the fuel filter assembly and install the mounting bolts.</li></ul>",
"file": "",
"display_order": "45"
},
{
"step_name": "Step-6",
"content_type": "Torque Value",
"content": "<b>Torque : 25 \u00b1 5 Nm</b>",
"file": "",
"display_order": "46"
},
{
"step_name": "Step-7",
"content_type": "File",
"content": "",
"file": "/files/W4A170025_0000346813.jpg",
"display_order": "47"
},
{
"step_name": "Step-7",
"content_type": "Description",
"content": "<ul><li>Reconnect the fuel filter fuel return line quick coupler.</li></ul>",
"file": "",
"display_order": "48"
},
{
"step_name": "Step-7",
"content_type": "Notice",
"content": "<ul><li><b>All are quick fix connectors, press gently and refit it carefully; avoid seal damages.</b> </li><li><b>Check and ensure proper fitment of \u00a0fuel lines, any leakage can lead to fire.</b></li> </ul>",
"file": "",
"display_order": "49"
},
{
"step_name": "Step-8",
"content_type": "File",
"content": "",
"file": "/files/W4A150260.jpg",
"display_order": "50"
},
{
"step_name": "Step-8",
"content_type": "Description",
"content": "<ul><li>Reconnect the fuel filter fuel supply pipe quick coupler.</li></ul>",
"file": "",
"display_order": "51"
},
{
"step_name": "Step-8",
"content_type": "Notice",
"content": "<ul><li><b>All are quick fix connectors, press gently and refit it carefully; avoid seal damages. </b></li><li><b>Check and ensure proper fitment of fuel lines, any leakage can lead to fire.</b> </li> </ul>",
"file": "",
"display_order": "52"
},
{
"step_name": "Step-9",
"content_type": "File",
"content": "",
"file": "",
"display_order": "53"
},
{
"step_name": "Step-9",
"content_type": "Description",
"content": "<ul><li>Reconnect the fuel filter electrical connector.</li></ul>",
"file": "",
"display_order": "54"
},
{
"step_name": "Step-9",
"content_type": "Caution",
"content": "<ul><li><b>Always use recommended filter element only.</b></li><li><b>Before removing the fuel filter, open the fuel tank cap to release the pressure from the tank and fuel lines. </b></li><li><b>Fuel filter cartridge needs to be replaced earlier in case of repeat water in fuel warning in cluster even after the water is drained from the system. </b></li></ul>",
"file": "",
"display_order": "55"
}
]
}
]
},
{
"subSystemdisplayorder": 5,
"systems": "Fuel System",
"sub_systems": "Water In Fuel Filter - Clean",
"symptom": 0,
"component": 0,
"estimated_time": null,
"rts": null,
"mat": null,
"cover_image": null,
"active_status": true,
"Config Kilometer": [],
"procedure_status": "Publish Ready",
"procedure_link": "Thar.AX-0432-Water In Fuel Filter - Clean-en",
"Procedure_details": [
{
"procedure_name": "Overview",
"steps": [
{
"step_name": "Overview",
"content_type": "File",
"content": ",",
"file": "/files/W4A130307.jpg,/files/W4A170267.jpg",
"display_order": "1,2"
},
{
"step_name": "Preliminary Activities",
"content_type": "Description",
"content": "<ol><li>Park the vehicle on level work bay.</li><li>Open the bonnet and lock it in open position using bonnet stay rod.</li></ol>",
"file": "",
"display_order": "3"
},
{
"step_name": "Tools Required",
"content_type": "File",
"content": "",
"file": "/files/W4A090056.jpg",
"display_order": "4"
}
]
},
{
"procedure_name": "Sediment Draining",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": "",
"file": "/files/W4A120024.jpg",
"display_order": "5"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "<ul><li>Connect the transparent pipe to the drain \u00a0plug outlet of the fuel filter assembly</li></ul>",
"file": "",
"display_order": "6"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": "",
"file": "/files/W4A100016.jpg",
"display_order": "7"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "<ul><li>Using a Nose plier, rotate drain plug anticlockwise till the water starts flowing from the tube.</li></ul>",
"file": "",
"display_order": "8"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "<ul><li><b>Drain plug requires hand tight only; do not use any tool and avoid over tightening.</b></li><li><b>Do not over tight the drain plug</b></li></ul>",
"file": "",
"display_order": "9"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": "",
"file": "/files/W4A100061.jpg",
"display_order": "10"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "<ul><li>Rotate drain plug in clockwise directio \u00a0to stop the flow as soon as water gets over and fuel flow starts. Tighten the drain plug.</li></ul>",
"file": "",
"display_order": "11"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ul><li>Start the engine and check for any leaks.</li></ul>",
"file": "",
"display_order": "12"
}
]
}
]
}
]
},
{
"systemdisplayorder": 1,
"system_name": "Air Intake",
"icon_file": null,
"myid": 1000,
"active_status": true,
"Assets": [
{
"systemdisplayorder": 1,
"system_asset": "/private/files/CAN Communication (D)_v3.mp4"
}
],
"Subsystems": [
{
"subSystemdisplayorder": 1,
"systems": "Air Intake",
"sub_systems": "Air Filter Element Clean",
"symptom": 0,
"component": 0,
"estimated_time": null,
"rts": null,
"mat": null,
"cover_image": null,
"active_status": true,
"Config Kilometer": [],
"procedure_status": "Publish Ready",
"procedure_link": "Thar.AX-0432-Air Filter Element Clean-en",
"Procedure_details": [
{
"procedure_name": "Overview",
"steps": [
{
"step_name": "Overview",
"content_type": "File",
"content": null,
"file": "/files/ESP OFF.jpg,/files/W4A160067.jpg,/files/W4A130334.jpg",
"display_order": "1,2,3"
},
{
"step_name": "Overview",
"content_type": "Description",
"content": "The air cleaner element is Non woven +Pleated Media type (Dry Type). Filtration happens in two stages. Coarser particles are filtered in first stage by foam media and fine particles are filtered by Paper media in second stage. The dust and other fine particles which are sucked inside along with air gets trapped in the air cleaner while passing through the filter element.",
"file": null,
"display_order": "4"
},
{
"step_name": "Overview",
"content_type": "Notice",
"content": "Don\u2019t tap or hit the filter element.",
"file": null,
"display_order": "5"
},
{
"step_name": "Preliminary Activities",
"content_type": "Description",
"content": "Park the vehicle on flat work bay.Open the bonnet and lock it in open position using bonnet stay rod.",
"file": null,
"display_order": "6"
},
{
"step_name": "Tools Required",
"content_type": "File",
"content": null,
"file": "/files/W4A120270.jpg",
"display_order": "7"
}
]
},
{
"procedure_name": "Removal",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": null,
"file": "/files/Hill Hold.jpg",
"display_order": "8"
},
{
"step_name": "Step-1",
"content_type": "Caution",
"content": "The air filter element should be inspected and replaced from time to time, when driving under the following conditions:Unpaved road.Dusty air-polluted road.Long-term driving in rainy weather.",
"file": null,
"display_order": "9"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "Using a 5 mm allen key, Unscrew air cleaner top housing mounting allen screws and lift the top housing.",
"file": null,
"display_order": "10"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": null,
"file": "/files/W4A150059.jpg",
"display_order": "11"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "Gently take out the air cleaner element from the housing.",
"file": null,
"display_order": "12"
}
]
},
{
"procedure_name": "Cleaning",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": null,
"file": "/files/W4A020124.jpg",
"display_order": "13"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "Clean the inner side of the air cleaner housing using a lint free cloth.",
"file": null,
"display_order": "14"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": null,
"file": "/files/W4A020013.jpg,/files/W4A020011.jpg,/files/W4A020012.jpg",
"display_order": "15,16,17"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "Blow the compressed air from the top clean side of filter element.",
"file": null,
"display_order": "18"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "Blow the compress air from the top clean side of filter element (From Paper side).Do not blow the air from bottom dirty side (Foam side).While cleaning, ensure the air pressure should be less than 2 bar.",
"file": null,
"display_order": "19"
}
]
},
{
"procedure_name": "Installation",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": null,
"file": "/files/W4A020124.jpg",
"display_order": "20"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "Clean the inner side of the air cleaner housing using a lint free cloth.",
"file": null,
"display_order": "21"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": null,
"file": "/files/W4A020017.jpg",
"display_order": "22"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "Gently insert the air cleaner element inside the air cleaner housing.",
"file": null,
"display_order": "23"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "During Installation ensure to keep foam side of the filter element in the bottom side.Ensure dust should not fall inside the clean hose area while fitting.Ensure dust should not fall inside the clean hose area while fitting.",
"file": null,
"display_order": "24"
},
{
"step_name": "Step-2",
"content_type": "Caution",
"content": "Always use recommended genuine air filter element.Do not tap or hit the new filter element.",
"file": null,
"display_order": "25"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": null,
"file": "/files/W4A020123.jpg",
"display_order": "26"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "Refit the air cleaner top housing and install the mounting allen screws.",
"file": null,
"display_order": "27"
},
{
"step_name": "Step-3",
"content_type": "Torque Value",
"content": "Torque : 10 Nm",
"file": null,
"display_order": "28"
}
]
}
]
}
]
},
{
"systemdisplayorder": 4,
"system_name": "Exhaust & Emission Control",
"icon_file": null,
"myid": 1001,
"active_status": true,
"Assets": [
{
"systemdisplayorder": 2,
"system_asset": "/private/files/ECU IP & OP (D)_v2.mp4"
}
],
"Subsystems": [
{
"subSystemdisplayorder": 4,
"systems": "Exhaust & Emission Control",
"sub_systems": "Precautions & Handling Of Dosing Module (DM) & Supply Module SM",
"symptom": 0,
"component": 0,
"estimated_time": null,
"rts": null,
"mat": null,
"cover_image": null,
"active_status": true,
"Config Kilometer": [],
"procedure_status": "Publish Ready",
"procedure_link": "Thar.AX-0432-Precautions & Handling Of Dosing Module (DM) & Supply Module SM-en",
"Procedure_details": [
{
"procedure_name": "Overview",
"steps": [
{
"step_name": "Step-1",
"content_type": "File",
"content": "",
"file": "/files/Rear Fog Lamp.jpg",
"display_order": "1"
},
{
"step_name": "Step-1",
"content_type": "Heading",
"content": "<b>Do\u2019s &amp; Don\u2019ts</b>",
"file": null,
"display_order": "2"
},
{
"step_name": "Step-1",
"content_type": "Description",
"content": "<ul><li>Do not hold the Supply Module while carry DEF tank.</li></ul>",
"file": null,
"display_order": "3"
},
{
"step_name": "Step-2",
"content_type": "File",
"content": "",
"file": "/files/W4A080026.jpg",
"display_order": "4"
},
{
"step_name": "Step-2",
"content_type": "Description",
"content": "<ul><li>Do not handle Supply Module using connectors, complete housing to be held to avoid any type of damages.</li> </ul>",
"file": null,
"display_order": "5"
},
{
"step_name": "Step-3",
"content_type": "File",
"content": "",
"file": "/files/W4A130187.jpg",
"display_order": "6"
},
{
"step_name": "Step-3",
"content_type": "Description",
"content": "<ul><li>Handle Dosing Module using housing and not on connectors to avoid any type of damages.</li></ul>",
"file": null,
"display_order": "7"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ul><li>Structural changes of the Dosing Module is not permitted.</li><li>Dismounting of dosing valve out of the cooling body is not allowed.</li></ul>",
"file": null,
"display_order": "8"
},
{
"step_name": "Step-4",
"content_type": "Description",
"content": "<ol><li><b>Avoid painting or application of other coatings on Dosing Module (DM) &amp; Supply Module (SM) to ensure lifetime &amp; functionality.</b></li><li><b>Always remove (manually) protection caps of DM &amp; SM just before assembly of its mating pipes/cables, to avoid contamination of the system.</b></li><li><b>Only use recommended tools for remove &amp; Installation of DM &amp; SM. After removing, cover the openings with protective caps to prevent the entry of contaminants.</b></li><li><b>The entry of contaminants in the interfaces of the DM must be prevented during Installation &amp; removing of DM.</b></li></ol>",
"file": null,
"display_order": "9"
},
{
"step_name": "Step-5",
"content_type": "Heading",
"content": "<b>Storage Guidelines<b></b></b>",
"file": null,
"display_order": "10"
},
{
"step_name": "Step-5",
"content_type": "Description",
"content": "<ol><li>Dosing Module (DM) &amp; Supply Module (SM) should not be handled as bulk goods, as it can damage the parts. If a part falls down, it must be scrapped, even if it looks visually ok, to avoid any latent damages leading emission issues.</li> <li>Parts have to be stored in original M&amp;M packaging.</li> <li>Parts needs to be protected against rain, snow, heat sources and dust.</li> <li>Max. storage period of DM &amp; SM should be not more than 4 years.</li> <li>Avoid any damages to Supply Module while storing DEF tank.</li></ol>",
"file": null,
"display_order": "11"
}
]
}
]
}
]
}
]
}
},
{
"StepCount": 106
}
]

25
smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.py

@ -8,6 +8,7 @@ import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
current_db_name = frappe.conf.get("db_name")
def execute(filters=None):
columns, data = [], []
columns,lang = get_columns()
@ -16,12 +17,12 @@ def execute(filters=None):
def get_data():
custom_lang = frappe.db.sql("""SELECT lang_code FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True)
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True)
queryAppendLang = ""
for d in custom_lang:
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" %(d[0],d[0])
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
queryAppendLang += q
sel = ""
@ -37,19 +38,19 @@ def get_data():
%s
From _d6463952657fa86c.`tabDrive`
LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
ON _d6463952657fa86c.`tabDrive`.drive = tabTrans.source_text
From %s.`tabDrive`
LEFT JOIN %s.`tabTranslation` as tabTrans
ON %s.`tabDrive`.drive = tabTrans.source_text
LEFT JOIN (Select tabLang.languageCode as languageCode
,_d6463952657fa86c.tabTranslation.source_text as sourceText
, _d6463952657fa86c.tabTranslation.translated_text as translated_text
,%s.tabTranslation.source_text as sourceText
, %s.tabTranslation.translated_text as translated_text
%s
From _d6463952657fa86c.tabTranslation
From %s.tabTranslation
INNER JOIN (SELECT tanLang.language_name as language_name
, tanLang.language_code as languageCode
FROM _d6463952657fa86c.tabLanguage as tanLang) as tabLang
ON _d6463952657fa86c.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON _d6463952657fa86c.`tabDrive`.drive = tabTranslation.sourceText;""" % (sel ,queryAppendLang)
FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabDrive`.drive = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True)
@ -99,7 +100,7 @@ def get_columns():
_("Modified On") + ":Datetime/:200", _("Status") + ":Data/:100",_("Drive") + ":Data/:220",
]
lang = []
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_dict=1)
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1)
# frappe.msgprint(str(custom_lang))
for d in custom_lang:
lang.append(cstr(d["lang_name"])+ "::220")

6
smart_service/mahindra_smart_service/report/_fuel_translation/_fuel_translation.py

@ -17,7 +17,6 @@ def execute(filters=None):
def get_data():
custom_lang = frappe.db.sql("""SELECT lang_code FROM `tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True)
queryAppendLang = ""
for d in custom_lang:
@ -92,17 +91,16 @@ def get_data():
def get_columns():
current_db_name = frappe.conf.get("db_name")
columns = []
columns += [
_("Modified On") + ":Datetime/:200", _("Status") + ":Data/:100",_("Fuel") + ":Data/:220",
]
lang = []
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_dict=1)
# frappe.msgprint(str(custom_lang))
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM {}.`tabCustom Languages` where lang_code <> "en" order by lang_name """.format(current_db_name),as_dict=1)
for d in custom_lang:
lang.append(cstr(d["lang_name"])+ "::220")
# frappe.msgprint(str(lang))
columns += lang
return columns,lang

4
smart_service/mahindra_smart_service/report/_procedure_report/_procedure_report.py

@ -208,8 +208,8 @@ def get_columns():
"width": 150
}
]
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" """,as_dict=1)
current_db_name = frappe.conf.get("db_name")
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name FROM {}.`tabCustom Languages` where lang_code <> "en" """.format(current_db_name),as_dict=1)
lang=[]
for i in custom_lang:
langField = {

34
smart_service/mahindra_smart_service/report/_sub_systems_translation/_sub_systems_translation.py

@ -8,6 +8,8 @@ import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
current_db_name = frappe.conf.get("db_name")
def execute(filters=None):
columns, data = [], []
columns,lang = get_columns()
@ -15,13 +17,13 @@ def execute(filters=None):
return columns, data
def get_data():
custom_lang = frappe.db.sql("""SELECT lang_code FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True)
custom_lang = frappe.db.sql("""SELECT lang_code FROM {}.`tabCustom Languages` where lang_code <> "en" order by lang_name""".format(current_db_name),as_list=True)
queryAppendLang = ""
for d in custom_lang:
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" %(d[0],d[0])
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN '%s'.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
queryAppendLang += q
sel = ""
@ -34,22 +36,20 @@ def get_data():
`tabSub Systems`.modified as "Modified On",
`tabSub Systems`.active_status as "Status",
`tabSub Systems`.sub_system_name as 'Vehicle Segment'
%s
From _d6463952657fa86c.`tabSub Systems`
LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
ON _d6463952657fa86c.`tabSub Systems`.sub_system_name = tabTrans.source_text
{1}
From {0}.`tabSub Systems`
LEFT JOIN {0}.`tabTranslation` as tabTrans
ON {0}.`tabSub Systems`.sub_system_name = tabTrans.source_text
LEFT JOIN (Select tabLang.languageCode as languageCode
,_d6463952657fa86c.tabTranslation.source_text as sourceText
, _d6463952657fa86c.tabTranslation.translated_text as translated_text
%s
From _d6463952657fa86c.tabTranslation
,{0}.tabTranslation.source_text as sourceText
, {0}.tabTranslation.translated_text as translated_text
{2}
From {0}.tabTranslation
INNER JOIN (SELECT tanLang.language_name as language_name
, tanLang.language_code as languageCode
FROM _d6463952657fa86c.tabLanguage as tanLang) as tabLang
ON _d6463952657fa86c.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON _d6463952657fa86c.`tabSub Systems`.sub_system_name = tabTranslation.sourceText;""" % (sel ,queryAppendLang)
FROM {0}.tabLanguage as tanLang) as tabLang
ON {0}.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON {0}.`tabSub Systems`.sub_system_name = tabTranslation.sourceText;""" .format(current_db_name,sel ,queryAppendLang)
data = frappe.db.sql(actualQuery,as_list=True)
@ -99,7 +99,7 @@ def get_columns():
_("Modified On") + ":Datetime/:200", _("Status") + ":Data/:100",_("Sub Systems") + ":Data/:300",
]
lang = []
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_dict=1)
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM {0}.`tabCustom Languages` where lang_code <> "en" order by lang_name""".format(current_db_name),as_dict=1)
# frappe.msgprint(str(custom_lang))
for d in custom_lang:
lang.append(cstr(d["lang_name"])+ "::300")

25
smart_service/mahindra_smart_service/report/_systems_translation/_systems_translation.py

@ -8,6 +8,7 @@ import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
current_db_name = frappe.conf.get("db_name")
def execute(filters=None):
columns, data = [], []
columns,lang = get_columns()
@ -16,12 +17,12 @@ def execute(filters=None):
def get_data():
custom_lang = frappe.db.sql("""SELECT lang_code FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True)
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True)
queryAppendLang = ""
for d in custom_lang:
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" %(d[0],d[0])
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
queryAppendLang += q
sel = ""
@ -37,19 +38,19 @@ def get_data():
%s
From _d6463952657fa86c.`tabSystems`
LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
ON _d6463952657fa86c.`tabSystems`.system_name = tabTrans.source_text
From %s.`tabSystems`
LEFT JOIN %s.`tabTranslation` as tabTrans
ON %s.`tabSystems`.system_name = tabTrans.source_text
LEFT JOIN (Select tabLang.languageCode as languageCode
,_d6463952657fa86c.tabTranslation.source_text as sourceText
, _d6463952657fa86c.tabTranslation.translated_text as translated_text
,%s.tabTranslation.source_text as sourceText
, %s.tabTranslation.translated_text as translated_text
%s
From _d6463952657fa86c.tabTranslation
From %s.tabTranslation
INNER JOIN (SELECT tanLang.language_name as language_name
, tanLang.language_code as languageCode
FROM _d6463952657fa86c.tabLanguage as tanLang) as tabLang
ON _d6463952657fa86c.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON _d6463952657fa86c.`tabSystems`.system_name = tabTranslation.sourceText;""" % (sel ,queryAppendLang)
FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabSystems`.system_name = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,)
data = frappe.db.sql(actualQuery,as_list=True)
@ -99,7 +100,7 @@ def get_columns():
_("Modified On") + ":Datetime/:200", _("Status") + ":Data/:100",_("Systems") + ":Data/:300",
]
lang = []
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_dict=1)
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1)
# frappe.msgprint(str(custom_lang))
for d in custom_lang:
lang.append(cstr(d["lang_name"])+ "::300")

26
smart_service/mahindra_smart_service/report/_transmission_translation/_transmission_translation.py

@ -7,7 +7,7 @@ from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
current_db_name = frappe.conf.get("db_name")
def execute(filters=None):
columns, data = [], []
columns,lang = get_columns()
@ -16,12 +16,12 @@ def execute(filters=None):
def get_data():
custom_lang = frappe.db.sql("""SELECT lang_code FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True)
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True)
queryAppendLang = ""
for d in custom_lang:
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" %(d[0],d[0])
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
queryAppendLang += q
sel = ""
@ -37,19 +37,19 @@ def get_data():
%s
From _d6463952657fa86c.`tabTransmission`
LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
ON _d6463952657fa86c.`tabTransmission`.transmission = tabTrans.source_text
From %s.`tabTransmission`
LEFT JOIN %s.`tabTranslation` as tabTrans
ON %s.`tabTransmission`.transmission = tabTrans.source_text
LEFT JOIN (Select tabLang.languageCode as languageCode
,_d6463952657fa86c.tabTranslation.source_text as sourceText
, _d6463952657fa86c.tabTranslation.translated_text as translated_text
,%s.tabTranslation.source_text as sourceText
, %s.tabTranslation.translated_text as translated_text
%s
From _d6463952657fa86c.tabTranslation
From %s.tabTranslation
INNER JOIN (SELECT tanLang.language_name as language_name
, tanLang.language_code as languageCode
FROM _d6463952657fa86c.tabLanguage as tanLang) as tabLang
ON _d6463952657fa86c.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON _d6463952657fa86c.`tabTransmission`.transmission = tabTranslation.sourceText;""" % (sel ,queryAppendLang)
FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabTransmission`.transmission = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True)
@ -99,7 +99,7 @@ def get_columns():
_("Modified On") + ":Datetime/:200", _("Status") + ":Data/:100",_("Transmission") + ":Data/:220",
]
lang = []
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_dict=1)
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1)
# frappe.msgprint(str(custom_lang))
for d in custom_lang:
lang.append(cstr(d["lang_name"])+ "::220")

3
smart_service/mahindra_smart_service/report/_variant_translation/_variant_translation.py

@ -8,6 +8,7 @@ import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
current_db_name = frappe.conf.get("db_name")
def execute(filters=None):
columns, data = [], []
columns,lang = get_columns()
@ -99,7 +100,7 @@ def get_columns():
_("Modified On") + ":Data/:240", _("Status") + ":Data/:100", _("Vehicle") + ":Data/:200",_("Variant") + ":Data/:220",
]
lang = []
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_dict=1)
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1)
# frappe.msgprint(str(custom_lang))
for d in custom_lang:
lang.append(cstr(d["lang_name"])+ "::220")

25
smart_service/mahindra_smart_service/report/_vehicle_segment_translation/_vehicle_segment_translation.py

@ -7,6 +7,7 @@ from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
current_db_name = frappe.conf.get("db_name")
def execute(filters=None):
columns, data = [], []
@ -16,12 +17,12 @@ def execute(filters=None):
def get_data():
custom_lang = frappe.db.sql("""SELECT lang_code FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True)
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True)
queryAppendLang = ""
for d in custom_lang:
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" %(d[0],d[0])
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
queryAppendLang += q
sel = ""
@ -37,19 +38,19 @@ def get_data():
%s
From _d6463952657fa86c.`tabVehicle Segment`
LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
ON _d6463952657fa86c.`tabVehicle Segment`.vehicle_segment = tabTrans.source_text
From %s.`tabVehicle Segment`
LEFT JOIN %s.`tabTranslation` as tabTrans
ON %s.`tabVehicle Segment`.vehicle_segment = tabTrans.source_text
LEFT JOIN (Select tabLang.languageCode as languageCode
,_d6463952657fa86c.tabTranslation.source_text as sourceText
, _d6463952657fa86c.tabTranslation.translated_text as translated_text
,%s.tabTranslation.source_text as sourceText
, %s.tabTranslation.translated_text as translated_text
%s
From _d6463952657fa86c.tabTranslation
From %s.tabTranslation
INNER JOIN (SELECT tanLang.language_name as language_name
, tanLang.language_code as languageCode
FROM _d6463952657fa86c.tabLanguage as tanLang) as tabLang
ON _d6463952657fa86c.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON _d6463952657fa86c.`tabVehicle Segment`.vehicle_segment = tabTranslation.sourceText;""" % (sel ,queryAppendLang)
FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabVehicle Segment`.vehicle_segment = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True)
@ -99,7 +100,7 @@ def get_columns():
_("Modified On") + ":Datetime/:200", _("Status") + ":Data/:100",_("Vehicle Segment") + ":Data/:220",
]
lang = []
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_dict=1)
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1)
# frappe.msgprint(str(custom_lang))
for d in custom_lang:
lang.append(cstr(d["lang_name"])+ "::220")

26
smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.py

@ -7,7 +7,7 @@ from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
current_db_name = frappe.conf.get("db_name")
def execute(filters=None):
columns, data = [], []
columns,lang = get_columns()
@ -16,12 +16,12 @@ def execute(filters=None):
def get_data():
custom_lang = frappe.db.sql("""SELECT lang_code FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True)
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True)
queryAppendLang = ""
for d in custom_lang:
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" %(d[0],d[0])
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
queryAppendLang += q
sel = ""
@ -37,19 +37,19 @@ def get_data():
%s
From _d6463952657fa86c.`tabVehicle`
LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
ON _d6463952657fa86c.`tabVehicle`.vehicle = tabTrans.source_text
From %s.`tabVehicle`
LEFT JOIN %s.`tabTranslation` as tabTrans
ON %s.`tabVehicle`.vehicle = tabTrans.source_text
LEFT JOIN (Select tabLang.languageCode as languageCode
,_d6463952657fa86c.tabTranslation.source_text as sourceText
, _d6463952657fa86c.tabTranslation.translated_text as translated_text
,%s.tabTranslation.source_text as sourceText
, %s.tabTranslation.translated_text as translated_text
%s
From _d6463952657fa86c.tabTranslation
From %s.tabTranslation
INNER JOIN (SELECT tanLang.language_name as language_name
, tanLang.language_code as languageCode
FROM _d6463952657fa86c.tabLanguage as tanLang) as tabLang
ON _d6463952657fa86c.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON _d6463952657fa86c.`tabVehicle`.vehicle = tabTranslation.sourceText;""" % (sel ,queryAppendLang)
FROM %s.tabLanguage as tanLang) as tabLang
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation
ON %s.`tabVehicle`.vehicle = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True)
@ -99,7 +99,7 @@ def get_columns():
_("Modified On") + ":Datetime/:200", _("Status") + ":Data/:100",_("Vehicle") + ":Data/:220",
]
lang = []
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM _d6463952657fa86c.`tabCustom Languages` where lang_code <> "en" order by lang_name""",as_dict=1)
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1)
# frappe.msgprint(str(custom_lang))
for d in custom_lang:
lang.append(cstr(d["lang_name"])+ "::220")

2
smart_service/masters/doctype/custom_languages/custom_languages.json

@ -60,7 +60,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-04 10:28:32.515723",
"modified": "2022-01-18 16:41:19.156174",
"modified_by": "Administrator",
"module": "Masters",
"name": "Custom Languages",

8
smart_service/masters/doctype/variant/variant.json

@ -90,13 +90,15 @@
{
"fetch_from": "vehicle.myid",
"fieldname": "vehicle_id",
"fieldtype": "Read Only",
"label": "Vehicle ID"
"fieldtype": "Int",
"hidden": 1,
"label": "Vehicle ID",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-04 10:31:58.889317",
"modified": "2022-01-18 17:12:59.642252",
"modified_by": "Administrator",
"module": "Masters",
"name": "Variant",

92
smart_service/masters/doctype/vehi_master/vehi_master.js

@ -7,39 +7,29 @@ frappe.ui.form.on('Vehi_master', {
var path = "<htm><body><button class = 'btn btn-xs btn-default' data-fieldtype='Button' data-fieldname='clear' placeholder data-doctype='Vehi_master' id='clear' value>Clear</button></body></html> "
//wrapper = frm.fields_dict[d.parentfield].grid.grid_rows_by_docname[cdn].fields_dict["attach"].wrapper;
//$("<div>Loading...</div>").appendTo(wrapper);/
//frm.fields_dict['items'].grid.wrapper.find('.grid-attach').html(path);
//$(frm.fields_dict[d.parentfield].grid.grid_rows_by_docname[cdn].grid_form.fields_dict.attach.wrapper).html(path);
var me = this;
var item = cur_frm.fields_dict['items'].grid.open_grid_row.doc;
// clear(cur_frm.doc.name);
//var field = frappe.utils.filter_dict(cur_frm.fields_dict["items"].grid.grid_rows_by_docnam[cdn].docfields, {'fieldname': "attach"})[0];
//console.log(field)
//field.df.reqd = false;
//field.refresh()
//$(frm.fields_dict['items'].grid.attach.wrapper).html(path);
// $(frm.fields_dict['attach'].wrapper).html(path)
// cur_frm.fields_dict['items'].grid.get_field('attach').$wrapper.html(path);
// $(d.get_field('attach').wrapper).html(path);
//frm.get_field("payment_reconciliation_details").$wrapper.html(r.message);
// //$(frm.fields_dict[d.parentfield].grid.grid_rows_by_docname[cdn].grid_form.fields_dict.attach.wrapper).html(path);
},
refresh: function(frm,cdt,cdn) {
var d = locals[cdt][cdn];
var path = "<htm><body><button class = 'btn btn-xs btn-default' data-fieldtype='Button' data-fieldname='clear' placeholder data-doctype='Vehi_master' id='clear' value>Clear</button></body></html> "
//cur_frm.fields_dict["browse"].grid.grid_rows_by_docname[cdn].browse.wrapper.html(path);
//frm.fields_dict["items"].grid.grid_rows_by_docname[cdn].attach.refresh();
//$(d.fields_dict['attach'].wrapper).html(path);
// $(cur_frm.fields_dict['items'].grid.browse.wrapper).html(path);
//$(cur_frm.fields_dict[d.parentfield].grid.grid_rows_by_docname[cdn].grid_form.fields_dict.browse.wrapper).html(path);
//var field = frappe.utils.filter_dict(
//cur_frm.fields_dict["items"].grid.grid_rows_by_docname[cdn].docfields_dict.browse.wrapper).html(path);
//{'claim_amount': "claim_amount"})[0];
//field.df.reqd = true;
//field.refresh();
//clear(cur_frm.open_grid_row());
// $(frm.fields_dict[d.parentfield].grid.grid_rows_by_docname[cdn].grid_form.fields_dict.browse.wrapper).html(path);
var d = locals[cdt][cdn];
//$(frm.fields_dict[d.parentfield].grid.grid_rows_by_docname[cdn].grid_form.fields_dict.browse.wrapper).html(path);
var tabletransfer= frappe.model.get_doc("Vehi_master", cur_frm.doc.name)
$.each(tabletransfer.items, function(index, row){
console.log("inside");
var path = "<htm><body><button class = 'btn btn-xs btn-default' data-fieldtype='Button' data-fieldname='clear' placeholder data-doctype='Vehi_master' id='clear' value>Clear</button></body></html> "
//$(cur_frm.doc.items[i].browse.wrapper).html(path);
$(frm.fields_dict[row.parentfield].browse).html(path);
})
refresh: function(frm,cdt,cdn) {
// var d = locals[cdt][cdn];
// var tabletransfer= frappe.model.get_doc("Vehi_master", cur_frm.doc.name)
// $.each(tabletransfer.items, function(index, row){
// console.log("inside");
// var path = "<htm><body><button class = 'btn btn-xs btn-default' data-fieldtype='Button' data-fieldname='clear' placeholder data-doctype='Vehi_master' id='clear' value>Clear</button></body></html> "
// $(frm.fields_dict[row.parentfield].browse).html(path);
// })
if(cur_frm.doc.url){
var path = "<htm><body><button class = 'btn btn-xs btn-default' data-fieldtype='Button' data-fieldname='clear' placeholder data-doctype='Vehi_master' id='clear' value>Clear</button></body></html> "
$(cur_frm.fields_dict.attach.wrapper).html(path);
@ -54,29 +44,6 @@ frappe.ui.form.on('Vehi_master', {
})
});
}
/* for(var i=0;i<cur_frm.doc.items.length;i++){
console.log("inside loop");
if(cur_frm.doc.items[i].url){
console.log("inside loop")
var path = "<htm><body><button class = 'btn btn-xs btn-default' data-fieldtype='Button' data-fieldname='clear' placeholder data-doctype='Vehi_master' id='clear' value>Clear</button></body></html> "
$(cur_frm.doc.items[i].browse.wrapper).html(path);
//$(frm.fields_dict[cur_frm.doc.items[i].parentfield].grid.grid_rows_by_docname[cdn].grid_form.fields_dict.browse.wrapper).html(path);
const button = document.querySelector('#clear');
button.addEventListener('click', () => {
var path = "<htm><body><button class = 'btn btn-xs btn-default' data-fieldtype='Button' data-fieldname='browse' placeholder data-doctype='Vehi_master' id='browse' value>Browse</button></body></html>"
$(cur_frm.doc.items[i].browse.wrapper).html(path);
//$(frm.fields_dict[cur_frm.doc.items[i].parentfield].grid.grid_rows_by_docname[cdn].grid_form.fields_dict.browse.wrapper).html(path);
cur_frm.doc.url ='';
cur_frm.refresh_field('url');
$("#browse").click(function() {
choose_file(cur_frm.doc.name);
})
});
}
}*/
},
attach: function(frm){
choose_file(cur_frm.doc.name);
@ -178,7 +145,6 @@ frappe.ui.form.on('Vehi Master Item', {
})
function child_file(frm,cdt,cdn) {
//var child = locals[cdt][cdn];
var file_folder = '';
var child_docname = "items"
let dialog =new frappe.ui.Dialog({
@ -232,7 +198,6 @@ function child_file(frm,cdt,cdn) {
$(frm.fields_dict[d.parentfield].grid.grid_rows_by_docname[cdn].grid_form.fields_dict.attach.wrapper).html(path);
d.url ='';
cur_frm.refresh_fields();
console.log("DD" + d.url)
$("#attach").click(function() {
child_file(frm,cdt,cdn);
})
@ -243,19 +208,14 @@ function child_file(frm,cdt,cdn) {
dialog.hide();
},
secondary_action: function() {
window.location.reload()
frappe.model.set_value(cdt,cdn,'url','')
dialog.hide();
dialog.refresh();
//window.location.reload()
},
primary_action_label: __('Ok'),
secondary_action_label: __('Make File')
secondary_action_label: __('Clear File')
});
dialog.show();
dialog.refresh();
}
function clear(grid_row){
console.log("Grid");
var path = "<htm><body><button class = 'btn btn-xs btn-default' data-fieldtype='Button' data-fieldname='clear' placeholder data-doctype='Vehi_master' id='clear' value>Clear</button></body></html>"
// var d = locals[cdt][cdn];
//$(frm.fields_dict[d.parentfield].grid.grid_rows_by_docname[cdn].grid_form.fields_dict.browse.wrapper).html(path);
// $(grid_row.grid_form_fields_dict.browse.wrapper).html(path);
}

3
smart_service/masters/doctype/vehi_master/vehi_master.json

@ -29,7 +29,6 @@
{
"fieldname": "items",
"fieldtype": "Table",
"label": "Items",
"options": "Vehi Master Item"
},
{
@ -40,7 +39,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-17 09:37:46.913640",
"modified": "2022-01-18 10:24:48.167310",
"modified_by": "Administrator",
"module": "Masters",
"name": "Vehi_master",

2
smart_service/masters/doctype/vehi_master_item/vehi_master_item.json

@ -41,7 +41,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2022-01-13 20:08:24.540956",
"modified": "2022-01-18 16:44:52.692931",
"modified_by": "Administrator",
"module": "Masters",
"name": "Vehi Master Item",

2
smart_service/masters/doctype/vehicle/vehicle.json

@ -114,7 +114,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-12 16:52:01.907136",
"modified": "2022-01-18 17:39:19.520057",
"modified_by": "Administrator",
"module": "Masters",
"name": "Vehicle",

29
smart_service/templates/includes/login/_login.js

@ -68,25 +68,26 @@ const parseXmlToJson = (xml)=>{
}
isSubmit=1;
(async () => { //alert(JSON.stringify(args)); debugger;
const rawResponse = await fetch("http://www.mahindramile.com/WindowAuth/Service.asmx/ValidateCredential?LoginID="+args.usr+"&Password="+btoa(getPass));
const resStr = await rawResponse.text();
login.set_status('{{ _("Verifying...") }}', 'blue');
if(resStr){
const parseJson = parseXmlToJson(resStr);
if(parseJson){
//alert(JSON.stringify(parseJson));
if(parseJson.IsSuccessfull=='1'){
base_pwd = "TGluY3lAMjAyMQ=="
args.pwd = atob(base_pwd);
// const rawResponse = await fetch("http://www.mahindramile.com/WindowAuth/Service.asmx/ValidateCredential?LoginID="+args.usr+"&Password="+btoa(getPass));
// const resStr = await rawResponse.text();
// login.set_status('{{ _("Verifying...") }}', 'blue');
// if(resStr){
// const parseJson = parseXmlToJson(resStr);
// if(parseJson){
// //alert(JSON.stringify(parseJson));
// if(parseJson.IsSuccessfull=='1'){
// base_pwd = "TGluY3lAMjAyMQ=="
// args.pwd = atob(base_pwd);
}else{
// }else
// {
args.pwd=getPass;
// if(args.pwd!=getPass){
// frappe.msgprint('{{ _("Both login and password required") }}');
// }
}
}
}
// }
// }
// }
args.device = "desktop";
$('.loadingBlock').hide();
login.call(args);

BIN
smart_service/transactions/doctype/publish/__pycache__/publish.cpython-38.pyc

Binary file not shown.

6
smart_service/transactions/doctype/publish/publish.py

@ -5,6 +5,8 @@ import frappe
from frappe.model.document import Document
import json
current_db_name = frappe.conf.get("db_name")
class Publish(Document):
pass
@ -42,8 +44,8 @@ list1= []
# frappe.msgprint(str(inputText))
@frappe.whitelist()
def cal_ver(vehicle,lang,publish_type):
ver = frappe.db.sql("""select max(version),publish_type from _d6463952657fa86c.tabPublish where vehicle = '{vehi}' and language = '{lang}';""".format(vehi=vehicle,lang=lang))
ver1 = frappe.db.sql("""select max(version),publish_type from _d6463952657fa86c.tabPublish where vehicle = '{vehi}' and language = '{lang}' and publish_type='Global';""".format(vehi=vehicle,lang=lang))
ver = frappe.db.sql("""select max(version),publish_type from {current_db_name}.tabPublish where vehicle = '{vehi}' and language = '{lang}';""".format(current_db_name=current_db_name,vehi=vehicle,lang=lang))
ver1 = frappe.db.sql("""select max(version),publish_type from {current_db_name}.tabPublish where vehicle = '{vehi}' and language = '{lang}' and publish_type='Global';""".format(current_db_name=current_db_name,vehi=vehicle,lang=lang))
# frappe.msgprint(str(ver))
v = 0.0

0
smart_service/transactions/report/__init__.py

0
smart_service/transactions/report/audit_report/__init__.py

9
smart_service/transactions/report/audit_report/audit_report.js

@ -0,0 +1,9 @@
// Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
// For license information, please see license.txt
/* eslint-disable */
frappe.query_reports["Audit Report"] = {
"filters": [
]
};

32
smart_service/transactions/report/audit_report/audit_report.json

@ -0,0 +1,32 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2022-01-18 14:38:00.750373",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-18 14:38:00.750373",
"modified_by": "Administrator",
"module": "Transactions",
"name": "Audit Report",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Publish",
"report_name": "Audit Report",
"report_type": "Script Report",
"roles": [
{
"role": "_Publisher"
},
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

8
smart_service/transactions/report/audit_report/audit_report.py

@ -0,0 +1,8 @@
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
# import frappe
def execute(filters=None):
columns, data = [], []
return columns, data
Loading…
Cancel
Save