Browse Source

saftyupdate

master
hns 3 years ago
parent
commit
c36a822056
  1. BIN
      smart_service/__pycache__/hooks.cpython-38.pyc
  2. 13
      smart_service/add_ons/doctype/app_dealer/app_dealer.json
  3. 13
      smart_service/add_ons/doctype/app_device/app_device.json
  4. 13
      smart_service/add_ons/doctype/app_log/app_log.json
  5. 13
      smart_service/add_ons/doctype/app_preference/app_preference.json
  6. 43
      smart_service/add_ons/doctype/app_users/app_users.json
  7. 13
      smart_service/add_ons/doctype/application_menu/application_menu.json
  8. 42
      smart_service/add_ons/doctype/bookmark/bookmark.json
  9. 13
      smart_service/add_ons/doctype/circular/circular.json
  10. 13
      smart_service/add_ons/doctype/model_hit/model_hit.json
  11. 27
      smart_service/add_ons/doctype/model_usage/model_usage.json
  12. 13
      smart_service/add_ons/doctype/teknet_group/teknet_group.json
  13. 13
      smart_service/add_ons/doctype/teknet_module/teknet_module.json
  14. BIN
      smart_service/add_ons/doctype/user_feedback/__pycache__/user_feedback.cpython-38.pyc
  15. 12
      smart_service/add_ons/doctype/user_feedback/user_feedback.js
  16. 59
      smart_service/add_ons/doctype/user_feedback/user_feedback.json
  17. 8
      smart_service/add_ons/doctype/user_feedback/user_feedback.py
  18. 13
      smart_service/add_ons/doctype/user_feedback_types/user_feedback_types.json
  19. 11
      smart_service/add_ons/doctype/user_manual/user_manual.json
  20. 5
      smart_service/add_ons/report/_test/_test.json
  21. BIN
      smart_service/add_ons/report/feedback_report/__pycache__/__init__.cpython-38.pyc
  22. BIN
      smart_service/add_ons/report/feedback_report/__pycache__/feedback_report.cpython-38.pyc
  23. 18
      smart_service/add_ons/report/feedback_report/feedback_report.js
  24. 5
      smart_service/add_ons/report/feedback_report/feedback_report.json
  25. 43
      smart_service/add_ons/report/feedback_report/feedback_report.py
  26. BIN
      smart_service/add_ons/report/model_download_report/__pycache__/model_download_report.cpython-38.pyc
  27. 22
      smart_service/add_ons/report/model_download_report/model_download_report.js
  28. 5
      smart_service/add_ons/report/model_download_report/model_download_report.json
  29. 61
      smart_service/add_ons/report/model_download_report/model_download_report.py
  30. BIN
      smart_service/add_ons/report/model_hit_report/__pycache__/model_hit_report.cpython-38.pyc
  31. 25
      smart_service/add_ons/report/model_hit_report/model_hit_report.js
  32. 5
      smart_service/add_ons/report/model_hit_report/model_hit_report.json
  33. 98
      smart_service/add_ons/report/model_hit_report/model_hit_report.py
  34. BIN
      smart_service/add_ons/report/release_report/__pycache__/__init__.cpython-38.pyc
  35. BIN
      smart_service/add_ons/report/release_report/__pycache__/release_report.cpython-38.pyc
  36. BIN
      smart_service/apis/__pycache__/addon_api.cpython-38.pyc
  37. BIN
      smart_service/apis/__pycache__/app_user_login.cpython-38.pyc
  38. BIN
      smart_service/apis/__pycache__/master_api.cpython-38.pyc
  39. BIN
      smart_service/apis/__pycache__/publish_api.cpython-38.pyc
  40. BIN
      smart_service/apis/__pycache__/testPublish.cpython-38.pyc
  41. BIN
      smart_service/apis/__pycache__/transaction_api.cpython-38.pyc
  42. BIN
      smart_service/apis/__pycache__/update_validation.cpython-38.pyc
  43. 51
      smart_service/apis/addon_api.py
  44. 105
      smart_service/apis/app_user_login.py
  45. 21
      smart_service/apis/master_api.py
  46. 70
      smart_service/apis/publish_api.py
  47. 41
      smart_service/apis/testPublish.py
  48. 18
      smart_service/apis/transaction_api.py
  49. 288
      smart_service/apis/update_validation.py
  50. 43
      smart_service/fixtures/custom_field.json
  51. 27
      smart_service/hooks.py
  52. 2
      smart_service/mahindra_smart_service/doctype/release/release.js
  53. 4
      smart_service/mahindra_smart_service/doctype/release/release.py
  54. 1
      smart_service/mahindra_smart_service/report/_applog_translation/_applog_translation.js
  55. 5
      smart_service/mahindra_smart_service/report/_applog_translation/_applog_translation.json
  56. 3
      smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.js
  57. 8
      smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.json
  58. 81
      smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.py
  59. BIN
      smart_service/mahindra_smart_service/report/_file_structure/__pycache__/_file_structure.cpython-38.pyc
  60. 8
      smart_service/mahindra_smart_service/report/_file_structure/_file_structure.js
  61. 40
      smart_service/mahindra_smart_service/report/_file_structure/_file_structure.py
  62. BIN
      smart_service/mahindra_smart_service/report/_fuel_translation/__pycache__/_fuel_translation.cpython-38.pyc
  63. 2
      smart_service/mahindra_smart_service/report/_fuel_translation/_fuel_translation.js
  64. 5
      smart_service/mahindra_smart_service/report/_fuel_translation/_fuel_translation.json
  65. 74
      smart_service/mahindra_smart_service/report/_fuel_translation/_fuel_translation.py
  66. BIN
      smart_service/mahindra_smart_service/report/_procedure_report/__pycache__/_procedure_report.cpython-38.pyc
  67. 75
      smart_service/mahindra_smart_service/report/_procedure_report/_procedure_report.js
  68. 106
      smart_service/mahindra_smart_service/report/_procedure_report/_procedure_report.py
  69. BIN
      smart_service/mahindra_smart_service/report/_sub_systems_translation/__pycache__/_sub_systems_translation.cpython-38.pyc
  70. 1
      smart_service/mahindra_smart_service/report/_sub_systems_translation/_sub_systems_translation.js
  71. 5
      smart_service/mahindra_smart_service/report/_sub_systems_translation/_sub_systems_translation.json
  72. 76
      smart_service/mahindra_smart_service/report/_sub_systems_translation/_sub_systems_translation.py
  73. BIN
      smart_service/mahindra_smart_service/report/_systems_translation/__pycache__/_systems_translation.cpython-38.pyc
  74. 1
      smart_service/mahindra_smart_service/report/_systems_translation/_systems_translation.js
  75. 5
      smart_service/mahindra_smart_service/report/_systems_translation/_systems_translation.json
  76. 80
      smart_service/mahindra_smart_service/report/_systems_translation/_systems_translation.py
  77. BIN
      smart_service/mahindra_smart_service/report/_transmission_translation/__pycache__/_transmission_translation.cpython-38.pyc
  78. 1
      smart_service/mahindra_smart_service/report/_transmission_translation/_transmission_translation.js
  79. 8
      smart_service/mahindra_smart_service/report/_transmission_translation/_transmission_translation.json
  80. 81
      smart_service/mahindra_smart_service/report/_transmission_translation/_transmission_translation.py
  81. BIN
      smart_service/mahindra_smart_service/report/_variant_translation/__pycache__/_variant_translation.cpython-38.pyc
  82. 8
      smart_service/mahindra_smart_service/report/_variant_translation/_variant_translation.json
  83. 80
      smart_service/mahindra_smart_service/report/_variant_translation/_variant_translation.py
  84. BIN
      smart_service/mahindra_smart_service/report/_vehicle_segment_translation/__pycache__/_vehicle_segment_translation.cpython-38.pyc
  85. 5
      smart_service/mahindra_smart_service/report/_vehicle_segment_translation/_vehicle_segment_translation.json
  86. 76
      smart_service/mahindra_smart_service/report/_vehicle_segment_translation/_vehicle_segment_translation.py
  87. BIN
      smart_service/mahindra_smart_service/report/_vehicle_translation/__pycache__/_vehicle_translation.cpython-38.pyc
  88. 1
      smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.js
  89. 5
      smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.json
  90. 81
      smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.py
  91. BIN
      smart_service/mahindra_smart_service/report/installation_report/__pycache__/installation_report.cpython-38.pyc
  92. 16
      smart_service/mahindra_smart_service/report/installation_report/installation_report.js
  93. 5
      smart_service/mahindra_smart_service/report/installation_report/installation_report.json
  94. 58
      smart_service/mahindra_smart_service/report/installation_report/installation_report.py
  95. BIN
      smart_service/mahindra_smart_service/report/login_report/__pycache__/login_report.cpython-38.pyc
  96. 16
      smart_service/mahindra_smart_service/report/login_report/login_report.js
  97. 5
      smart_service/mahindra_smart_service/report/login_report/login_report.json
  98. 53
      smart_service/mahindra_smart_service/report/login_report/login_report.py
  99. 16
      smart_service/masters/doctype/drive/drive.json
  100. 16
      smart_service/masters/doctype/fuel/fuel.json

BIN
smart_service/__pycache__/hooks.cpython-38.pyc

Binary file not shown.

13
smart_service/add_ons/doctype/app_dealer/app_dealer.json

@ -42,7 +42,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-07 15:24:29.839700",
"modified": "2022-01-28 12:57:33.359666",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "App Dealer",
@ -59,17 +59,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

13
smart_service/add_ons/doctype/app_device/app_device.json

@ -70,7 +70,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-07 15:21:49.906593",
"modified": "2022-01-28 12:56:52.746692",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "App Device",
@ -87,17 +87,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

13
smart_service/add_ons/doctype/app_log/app_log.json

@ -56,7 +56,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-13 12:56:37.716178",
"modified": "2022-01-28 12:57:26.348409",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "App Log",
@ -73,17 +73,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

13
smart_service/add_ons/doctype/app_preference/app_preference.json

@ -91,7 +91,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-11 11:57:35.291012",
"modified": "2022-01-28 12:43:00.846057",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "App Preference",
@ -108,17 +108,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

43
smart_service/add_ons/doctype/app_users/app_users.json

@ -24,22 +24,26 @@
"fieldname": "dealer",
"fieldtype": "Link",
"label": "Dealer",
"options": "App Dealer"
"options": "App Dealer",
"set_only_once": 1
},
{
"fieldname": "user_id",
"fieldtype": "Data",
"label": "User ID"
"label": "User ID",
"set_only_once": 1
},
{
"fieldname": "login_name",
"fieldtype": "Data",
"label": "Login Name"
"label": "Login Name",
"set_only_once": 1
},
{
"fieldname": "user_type",
"fieldtype": "Data",
"label": "User Type"
"label": "User Type",
"set_only_once": 1
},
{
"fieldname": "column_break_5",
@ -48,37 +52,43 @@
{
"fieldname": "first_name",
"fieldtype": "Data",
"label": "First Name"
"label": "First Name",
"set_only_once": 1
},
{
"fieldname": "last_name",
"fieldtype": "Data",
"label": "Last Name"
"label": "Last Name",
"set_only_once": 1
},
{
"fieldname": "skill_id",
"fieldtype": "Data",
"label": "Skill ID"
"label": "Skill ID",
"set_only_once": 1
},
{
"fieldname": "skill_name",
"fieldtype": "Data",
"label": "Skill Name"
"label": "Skill Name",
"set_only_once": 1
},
{
"fieldname": "email_id",
"fieldtype": "Data",
"label": "email ID"
"label": "email ID",
"set_only_once": 1
},
{
"fieldname": "active_status",
"fieldtype": "Data",
"label": "Active Status"
"label": "Active Status",
"set_only_once": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-07 15:21:14.132692",
"modified": "2022-01-28 12:56:59.183998",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "App Users",
@ -95,17 +105,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

13
smart_service/add_ons/doctype/application_menu/application_menu.json

@ -38,7 +38,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-10 17:17:13.447747",
"modified": "2022-01-28 12:58:40.400099",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Application Menu",
@ -55,17 +55,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

42
smart_service/add_ons/doctype/bookmark/bookmark.json

@ -20,53 +20,62 @@
{
"fieldname": "user_id",
"fieldtype": "Data",
"label": "User ID"
"label": "User ID",
"set_only_once": 1
},
{
"fieldname": "active_status",
"fieldtype": "Select",
"label": "Active Status",
"options": "Active\nInactive"
"options": "Active\nInactive",
"set_only_once": 1
},
{
"fieldname": "vehicle_segment_id",
"fieldtype": "Int",
"label": "Vehicle Segment ID"
"label": "Vehicle Segment ID",
"set_only_once": 1
},
{
"fieldname": "vehicle_id",
"fieldtype": "Int",
"label": "Vehicle ID"
"label": "Vehicle ID",
"set_only_once": 1
},
{
"fieldname": "system_id",
"fieldtype": "Int",
"label": "System ID"
"label": "System ID",
"set_only_once": 1
},
{
"fieldname": "sub_system_id",
"fieldtype": "Int",
"label": "Sub System ID"
"label": "Sub System ID",
"set_only_once": 1
},
{
"fieldname": "menu_id",
"fieldtype": "Int",
"label": "Menu ID"
"label": "Menu ID",
"set_only_once": 1
},
{
"fieldname": "km_details",
"fieldtype": "Data",
"label": "KM Details"
"label": "KM Details",
"set_only_once": 1
},
{
"fieldname": "variant_mapping_id",
"fieldtype": "Int",
"label": "Variant Mapping ID"
"fieldtype": "Data",
"label": "Variant Mapping ID",
"set_only_once": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-10 15:51:38.605212",
"modified": "2022-01-28 12:58:27.121914",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Bookmark",
@ -83,17 +92,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

13
smart_service/add_ons/doctype/circular/circular.json

@ -63,7 +63,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-11-17 12:44:50.899725",
"modified": "2022-01-28 12:44:24.971752",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Circular",
@ -80,17 +80,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Author",
"share": 1,
"write": 1
}
],
"search_fields": "description, status",

13
smart_service/add_ons/doctype/model_hit/model_hit.json

@ -65,7 +65,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-13 16:05:28.254820",
"modified": "2022-01-28 12:58:06.556118",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Model Hit",
@ -82,17 +82,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

27
smart_service/add_ons/doctype/model_usage/model_usage.json

@ -17,7 +17,9 @@
"system_id",
"sub_system_id",
"procedure_id",
"steps_id"
"steps_id",
"menu_id",
"language"
],
"fields": [
{
@ -79,11 +81,21 @@
"fieldname": "steps_id",
"fieldtype": "Data",
"label": "Steps ID"
},
{
"fieldname": "menu_id",
"fieldtype": "Data",
"label": "Menu ID"
},
{
"fieldname": "language",
"fieldtype": "Data",
"label": "Language"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-13 16:07:52.464530",
"modified": "2022-01-28 12:58:08.631540",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Model Usage",
@ -100,17 +112,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

13
smart_service/add_ons/doctype/teknet_group/teknet_group.json

@ -35,7 +35,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-07 14:16:08.204900",
"modified": "2022-01-28 12:56:24.520618",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Teknet Group",
@ -52,17 +52,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

13
smart_service/add_ons/doctype/teknet_module/teknet_module.json

@ -24,7 +24,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-07 14:16:01.110723",
"modified": "2022-01-28 12:56:14.758742",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Teknet Module",
@ -41,17 +41,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

BIN
smart_service/add_ons/doctype/user_feedback/__pycache__/user_feedback.cpython-38.pyc

Binary file not shown.

12
smart_service/add_ons/doctype/user_feedback/user_feedback.js

@ -2,7 +2,13 @@
// For license information, please see license.txt
frappe.ui.form.on('User Feedback', {
// refresh: function(frm) {
// }
validate: function(frm) {
if(frm.doc.status == "Closed"){
frappe.db.get_value('User', {name: frm.doc.modified_by}, 'username' , (r) =>{
cur_frm.set_value("closed_by",r.username);
cur_frm.set_value("closure_date",frm.doc.modified);
cur_frm.refresh_fields();
})
}
}
});

59
smart_service/add_ons/doctype/user_feedback/user_feedback.json

@ -1,6 +1,6 @@
{
"actions": [],
"autoname": "format:{subject}-{creation}",
"autoname": "UF-.#####",
"creation": "2021-11-08 16:59:12.277597",
"doctype": "DocType",
"editable_grid": 1,
@ -8,13 +8,15 @@
"field_order": [
"subject",
"feedback_type",
"attachment",
"attachments",
"column_break_2",
"user_name",
"status",
"date",
"section_break_8",
"description"
"description",
"closure_date",
"closed_by"
],
"fields": [
{
@ -22,7 +24,8 @@
"fieldtype": "Data",
"in_list_view": 1,
"label": "Subject",
"reqd": 1
"reqd": 1,
"set_only_once": 1
},
{
"fieldname": "column_break_2",
@ -33,7 +36,8 @@
"fieldtype": "Link",
"in_list_view": 1,
"label": "User Name",
"options": "App Users"
"options": "App Users",
"set_only_once": 1
},
{
"fieldname": "feedback_type",
@ -42,7 +46,8 @@
"in_standard_filter": 1,
"label": "Feedback Type",
"options": "User Feedback_Types",
"reqd": 1
"reqd": 1,
"set_only_once": 1
},
{
"fieldname": "status",
@ -53,11 +58,6 @@
"options": "Open\nClosed\nReopened",
"reqd": 1
},
{
"fieldname": "attachment",
"fieldtype": "Attach",
"label": "Attachment"
},
{
"fieldname": "section_break_8",
"fieldtype": "Section Break"
@ -65,7 +65,8 @@
{
"fieldname": "description",
"fieldtype": "Text Editor",
"label": "Description"
"label": "Description",
"set_only_once": 1
},
{
"fieldname": "date",
@ -73,12 +74,31 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Date",
"reqd": 1
"reqd": 1,
"set_only_once": 1
},
{
"fieldname": "attachments",
"fieldtype": "Int",
"label": "Attachments",
"read_only": 1
},
{
"fieldname": "closure_date",
"fieldtype": "Datetime",
"label": "Closure Date",
"read_only": 1
},
{
"fieldname": "closed_by",
"fieldtype": "Data",
"label": "Closed By",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-11 18:40:02.666060",
"modified": "2022-01-28 12:48:03.045078",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "User Feedback",
@ -95,17 +115,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Author",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

8
smart_service/add_ons/doctype/user_feedback/user_feedback.py

@ -1,8 +1,14 @@
# Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
# import frappe
import frappe
from frappe.model.document import Document
class UserFeedback(Document):
def validate(self):
pass
def onload(self):
attach = frappe.db.sql("""select count(name) as count from `tabFile` where attached_to_name = %s""",self.name,as_dict=True)
for x in attach:
frappe.db.sql("""update `tabUser Feedback` set attachments = %s where name = %s""",(x.count,self.name),as_dict=True)
frappe.db.commit()

13
smart_service/add_ons/doctype/user_feedback_types/user_feedback_types.json

@ -27,7 +27,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-11-08 17:10:06.584852",
"modified": "2022-01-28 12:49:56.113178",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "User Feedback_Types",
@ -44,17 +44,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Author",
"share": 1,
"write": 1
}
],
"search_fields": "status",

11
smart_service/add_ons/doctype/user_manual/user_manual.json

@ -34,7 +34,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2022-01-07 15:25:49.893509",
"modified": "2022-01-28 12:51:43.149442",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "User Manual",
@ -49,15 +49,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"print": 1,
"read": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

5
smart_service/add_ons/report/_test/_test.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-11 21:25:08.833206",
"modified": "2022-01-28 15:24:20.212174",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "_Test",
@ -21,9 +21,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

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

Binary file not shown.

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

Binary file not shown.

18
smart_service/add_ons/report/feedback_report/feedback_report.js

@ -4,6 +4,24 @@
frappe.query_reports["Feedback 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
},
]
};

5
smart_service/add_ons/report/feedback_report/feedback_report.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-18 14:38:51.113640",
"modified": "2022-01-28 15:22:37.473617",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Feedback Report",
@ -19,9 +19,6 @@
"report_name": "Feedback Report",
"report_type": "Script Report",
"roles": [
{
"role": "_Admin"
},
{
"role": "System Manager"
}

43
smart_service/add_ons/report/feedback_report/feedback_report.py

@ -1,8 +1,47 @@
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
# import frappe
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):
data = frappe.db.sql("""select uf.name,uf.date,uf.subject,uf.user_name,uf.status,uf.attachments,uf.closure_date,uf.closed_by,
uf.description,uf.feedback_type,dealer.dealer_code,dealer.zone,dealer.dealer_name,uf.closure_date,uf.closed_by,
dealer.area,au.user_id,au.first_name from `tabUser Feedback` uf,`tabApp Dealer` dealer,`tabApp Users` au
where uf.user_name = au.name and
(uf.modified between %s and %s) group by uf.name""",(filters.get('from_date'), filters.get('to_date')), as_dict=1)
#frappe.throw("DATA" + str(data))
if data:
return data
else:
frappe.msgprint('No Data for Selected Filters.')
def get_columns():
columns = [
{"label": _("Date"), "fieldname": "date", "fieldtype": "Date", "width": 100},
{"label": _("Feedback ID"), "fieldname": "name", "fieldtype": "Link", "options":"User Feedback","width": 120},
{"label": _("Feedback Type"), "fieldname": "feedback_type", "fieldtype": "Data", "width": 120},
{"label": _("Feedback Title"), "fieldname": "subject", "fieldtype": "Data", "width": 120},
{"label": _("Feedback Description"), "fieldname": "description", "fieldtype": "Text Editor", "width": 250},
{"label": _("Attachments"), "fieldname": "attachments", "fieldtype": "Data", "width": 100},
{"label": _("Feedback Status"), "fieldname": "status", "fieldtype": "Data", "width": 100},
{"label": _("User ID"), "fieldname": "user_id", "fieldtype":"Data","width": 100},
{"label": _("User Name"), "fieldname": "first_name", "fieldtype": "Data", "width": 150},
{"label": _("Zone"), "fieldname": "zone", "fieldtype": "Data", "width": 100},
{"label": _("Dealer Location"), "fieldname": "area", "fieldtype": "Data", "width": 140},
{"label": _("Dealer Code"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 120},
{"label": _("Dealer Name"), "fieldname": "dealer_name", "fieldtype": "Data", "width": 150},
{"label": _("Closure Date"), "fieldname": "closure_date", "fieldtype": "Data", "width": 150},
{"label": _("Closed By"), "fieldname": "closed_by", "fieldtype": "Data", "width": 120}
]
return columns

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

Binary file not shown.

22
smart_service/add_ons/report/model_download_report/model_download_report.js

@ -4,6 +4,28 @@
frappe.query_reports["Model Download 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" : "Vehicle",
"reqd": 0
}
]
};

5
smart_service/add_ons/report/model_download_report/model_download_report.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-18 14:37:03.336454",
"modified": "2022-01-28 15:22:50.511522",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Model Download Report",
@ -21,9 +21,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

61
smart_service/add_ons/report/model_download_report/model_download_report.py

@ -1,8 +1,67 @@
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
# import frappe
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
import datetime
current_db_name = frappe.conf.get("db_name")
def execute(filters=None):
columns, data = [], []
columns = get_columns()
data = get_data(filters)
return columns, data
def get_data(filters):
if filters.get('model'):
from_date=filters['from_date']
to_date=filters['to_date']
modelfilter=filters['model']
try:
vId=frappe.db.sql("""SELECT myid FROM _d6463952657fa86c.tabVehicle where vehicle='{0}';""".format(modelfilter), as_dict=1)
vId=vId[-1]
vId=vId['myid']
except:
frappe.msgprint('Vehicle ID Mismatching.')
data = frappe.db.sql("""SELECT date(date) as date, device_id, app_version, download_vehicle_id, download_vehicle_version, download_vehicle_date, download_vehicle_language_id, download_vehicle_current_version, user_id
FROM {0}.`tabModel Hit` WHERE download_vehicle_id='{1}' and (date(date) between '{2}' and '{3}');""".format(current_db_name, vId, from_date, to_date), as_dict=1)
for d in data:
d['download_vehicle_id']=modelfilter
if d['user_id']:
try:
dealer_info=frappe.db.sql("""SELECT dealer FROM {0}.`tabApp Users` where user_id='{1}';""".format(current_db_name, d['user_id']), as_dict=1)
dealer_info=dealer_info[-1]['dealer']
dealer_details=frappe.db.sql("""SELECT dealer_name,dealer_code,area as location,zone FROM {0}.`tabApp Dealer` where name='{1}';""".format(current_db_name, dealer_info), as_dict=1)
dealer_details=dealer_details[-1]
d['dealer_code']=dealer_details['dealer_code']
d['dealer_name']=dealer_details['dealer_name']
d['area']=dealer_details['location']
d['zone']=dealer_details['zone']
except:
pass
if data:
return data
else:
frappe.msgprint('No Data for Selected Filters.')
def get_columns():
columns = [
{"label": _("Date"), "fieldname": "date", "fieldtype": "Date", "width": 100},
{"label": _("Zone"), "fieldname": "zone", "fieldtype": "Data", "width": 100},
{"label": _("Dealer Location"), "fieldname": "area", "fieldtype": "Data", "width": 150},
{"label": _("Dealer Code"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 150},
{"label": _("Dealer Name"), "fieldname": "dealer_name", "fieldtype": "Data", "width": 150},
{"label": _("Device"), "fieldname": "device_id", "fieldtype": "Data", "width": 100},
{"label": _("Downloaded Vehicle"), "fieldname": "download_vehicle_id", "fieldtype": "Data", "width": 170},
{"label": _("Downloaded Version"), "fieldname": "download_vehicle_current_version", "fieldtype": "Data", "width": 250},
{"label": _("Downloaded Language"), "fieldname": "download_vehicle_language_id", "fieldtype": "Data", "width": 250},
{"label": _("App Version"), "fieldname": "app_version", "fieldtype": "Data", "width": 150}
]
return columns

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

Binary file not shown.

25
smart_service/add_ons/report/model_hit_report/model_hit_report.js

@ -19,19 +19,28 @@ frappe.query_reports["Model Hit Report"] = {
default: frappe.datetime.year_end(),
"reqd": 0
},
// {
// "fieldname":"model",
// "label": __("Model"),
// "fieldtype": "Link",
// "options" : "Vehicle",
// "reqd": 0
// },
{
"fieldname":"model",
"label": __("Model"),
"fieldtype": "Link",
"options" : "Vehicle",
"reqd": 0
},
{
"fieldname":"variant",
"label": __("Variant"),
"fieldtype": "Link",
"options" : "Variant",
"reqd": 0
"reqd": 0,
get_query: function(){
var model = frappe.query_report.get_filter_value('model');
return{
"query": "smart_service.add_ons.report.model_hit_report.model_hit_report.variant",
"filters":{
name: model,
}
}
}
}
]

5
smart_service/add_ons/report/model_hit_report/model_hit_report.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-18 14:36:07.869475",
"modified": "2022-01-28 15:23:04.344843",
"modified_by": "Administrator",
"module": "Add Ons",
"name": "Model Hit Report",
@ -21,9 +21,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

98
smart_service/add_ons/report/model_hit_report/model_hit_report.py

@ -8,6 +8,8 @@ from frappe.utils import cstr, cint, getdate
from frappe import msgprint, _
import datetime
current_db_name = frappe.conf.get("db_name")
def execute(filters=None):
@ -18,28 +20,101 @@ def execute(filters=None):
def get_data(filters):
if filters.get('variant') and filters.get('model'):
from_date=filters['from_date']
to_date=filters['to_date']
modelfilter=filters['model']
variantfilter=filters['variant']
variantfilter=variantfilter.split(".")
data = frappe.db.sql("""SELECT date as date, device_id, module_id, vehicle_id, variant_id, system_id, sub_system_id, procedure_id, steps_id, count(*) as count, user_id, language
FROM {0}.`tabModel Usage` WHERE vehicle_id='{1}' and variant_id='{2}' and (date(date) between '{3}' and '{4}')
GROUP BY date, user_id, module_id, device_id, vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id, language;""".format(current_db_name, modelfilter, variantfilter[1], from_date, to_date), as_dict=1)
for d in data:
if d['user_id']:
try:
dealer_info=frappe.db.sql("""SELECT dealer FROM {0}.`tabApp Users` where user_id='{1}';""".format(current_db_name, d['user_id']), as_dict=1)
dealer_info=dealer_info[-1]['dealer']
dealer_details=frappe.db.sql("""SELECT dealer_name,dealer_code,area as location,zone FROM {0}.`tabApp Dealer` where name='{1}';""".format(current_db_name, dealer_info), as_dict=1)
dealer_details=dealer_details[-1]
d['dealer_code']=dealer_details['dealer_code']
d['dealer_name']=dealer_details['dealer_name']
d['area']=dealer_details['location']
d['zone']=dealer_details['zone']
except:
pass
if filters.get('variant'):
data = frappe.db.sql("""SELECT date(date) as date, device_id, module_id, vehicle_id, variant_id, system_id, sub_system_id, procedure_id, steps_id, count(*) as count
FROM {0}.`tabModel Usage`
GROUP BY user_id, device_id, vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id;""".format(current_db_name), as_dict=1)
frappe.msgprint(str(filters))
if data:
return data
else:
frappe.throw('No Data for Selected Filters.')
frappe.msgprint('No Data for Selected Filters.')
elif filters.get('model'):
from_date=filters['from_date']
to_date=filters['to_date']
modelfilter=filters['model']
data = frappe.db.sql("""SELECT date as date, device_id, module_id, vehicle_id, variant_id, system_id, sub_system_id, procedure_id, steps_id, count(*) as count, user_id, language
FROM {0}.`tabModel Usage` WHERE vehicle_id='{1}' and (date(date) between '{2}' and '{3}')
GROUP BY date, user_id, module_id, device_id, vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id, language;""".format(current_db_name, modelfilter, from_date, to_date), as_dict=1)
for d in data:
if d['user_id']:
try:
dealer_info=frappe.db.sql("""SELECT dealer FROM {0}.`tabApp Users` where user_id='{1}';""".format(current_db_name, d['user_id']), as_dict=1)
dealer_info=dealer_info[-1]['dealer']
dealer_details=frappe.db.sql("""SELECT dealer_name,dealer_code,area as location,zone FROM {0}.`tabApp Dealer` where name='{1}';""".format(current_db_name, dealer_info), as_dict=1)
dealer_details=dealer_details[-1]
d['dealer_code']=dealer_details['dealer_code']
d['dealer_name']=dealer_details['dealer_name']
d['area']=dealer_details['location']
d['zone']=dealer_details['zone']
except:
pass
if data:
return data
else:
frappe.msgprint('No Data for Selected Filters.')
elif filters.get('variant'):
from_date=filters['from_date']
to_date=filters['to_date']
variantfilter=filters['variant']
variantfilter=variantfilter.split(".")
data = frappe.db.sql("""SELECT date as date, device_id, module_id, vehicle_id, variant_id, system_id, sub_system_id, procedure_id, steps_id, count(*) as count, user_id, language
FROM {0}.`tabModel Usage` WHERE vehicle_id='{1}' and variant_id='{2}' and (date(date) between '{3}' and '{4}')
GROUP BY date, user_id, module_id, device_id, vehicle_id, variant_id, variant_mapping_id, system_id, sub_system_id, procedure_id, steps_id, language;""".format(current_db_name, variantfilter[0], variantfilter[1], from_date, to_date), as_dict=1)
for d in data:
if d['user_id']:
try:
dealer_info=frappe.db.sql("""SELECT dealer FROM {0}.`tabApp Users` where user_id='{1}';""".format(current_db_name, d['user_id']), as_dict=1)
dealer_info=dealer_info[-1]['dealer']
dealer_details=frappe.db.sql("""SELECT dealer_name,dealer_code,area as location,zone FROM {0}.`tabApp Dealer` where name='{1}';""".format(current_db_name, dealer_info), as_dict=1)
dealer_details=dealer_details[-1]
d['dealer_code']=dealer_details['dealer_code']
d['dealer_name']=dealer_details['dealer_name']
d['area']=dealer_details['location']
d['zone']=dealer_details['zone']
except:
pass
if data:
return data
else:
frappe.msgprint('No Data for Selected Filters.')
def get_columns():
columns = [
{"label": _("Date"), "fieldname": "date", "fieldtype": "Date", "width": 100},
{"label": _("Zone"), "fieldname": "zone", "fieldtype": "Data", "width": 100},
{"label": _("Dealer Location"), "fieldname": "area", "fieldtype": "Data", "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_id", "fieldtype": "Data", "width": 100},
{"label": _("Module"), "fieldname": "module_id", "fieldtype": "Data", "width": 150},
{"label": _("Model"), "fieldname": "vehicle_id", "fieldtype": "Data", "width": 100},
@ -48,6 +123,13 @@ def get_columns():
{"label": _("Sub System"), "fieldname": "sub_system_id", "fieldtype": "Data", "width": 100},
{"label": _("Procedure"), "fieldname": "procedure_id", "fieldtype": "Data", "width": 100},
{"label": _("Steps"), "fieldname": "steps_id", "fieldtype": "Data", "width": 100},
{"label": _("Language"), "fieldname": "language", "fieldtype": "Data", "width": 100},
{"label": _("Count"), "fieldname": "count", "fieldtype": "Data", "width": 100}
]
return columns
@frappe.whitelist()
def variant(doctype,txt,searchfield,start,page_len,filters):
model = filters.get('name')
variant = frappe.db.sql("""select name from `tabVariant` where name like %s""",model+'%',as_list=True)
return variant

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

Binary file not shown.

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

Binary file not shown.

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__/testPublish.cpython-38.pyc

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

51
smart_service/apis/addon_api.py

@ -4,6 +4,7 @@ import json
current_db_name = frappe.conf.get("db_name")
@frappe.whitelist()
def addon(args):
if args == "circular":
@ -25,11 +26,11 @@ def addon(args):
else:
i["status"] = False
elif args == "teknet_group":
api = frappe.db.get_list(
"Teknet Group",
fields=["name","teknet_group_code", "teknet_group_description", "active_status"],
fields=["name", "teknet_group_code",
"teknet_group_description", "active_status"],
)
for i in api:
if i["active_status"] == "Active":
@ -56,6 +57,7 @@ def addon(args):
return api
@frappe.whitelist()
def bookmark(args, request):
if args == "get_bookmark":
@ -64,25 +66,26 @@ def bookmark(args,request):
lsd = request["LSD"]
api = frappe.db.get_list(
"Bookmark",
fields=["name","vehicle_segment_id", "vehicle_id","system_id","sub_system_id","menu_id","km_details","variant_mapping_id"],
fields=["name", "vehicle_segment_id", "vehicle_id", "system_id",
"sub_system_id", "menu_id", "km_details", "variant_mapping_id"],
filters={"modified": [">", lsd], "user_id": ["=", usrid]}
)
#
return api
if args == "update_bookmark":
try:
request = json.loads(request)
usrid = request["UserID"]
req = request["Bookmarkdetails"]
# bookmark_count=0
for i in req:
vehicle_seg_id = i["VehicleSegmentID"]
vehicle_id = i["VehicleID"]
variant_mapping_id = i["VariantMappingID"]
system_id = i["SystemID"]
sub_system_id = i["SubSystemID"]
menu_id = i["MenuID"]
kilometer_details = i["KmDetails"]
vehicle_seg_id = i["vehicle_segment_id"]
vehicle_id = i["vehicle_id"]
variant_mapping_id = i["variant_mapping_id"]
system_id = i["system_id"]
sub_system_id = i["sub_system_id"]
menu_id = i["menu_id"]
kilometer_details = i["km_details"]
is_deleted = i["IsDeleted"]
if is_deleted == False:
data = frappe.new_doc('Bookmark')
@ -96,20 +99,22 @@ def bookmark(args,request):
data.km_details = kilometer_details
data.variant_mapping_id = variant_mapping_id
data.insert(ignore_if_duplicate=True)
elif is_deleted == True:
frappe.delete_doc('Bookmark', i['name'])
# bookmark_count=bookmark_count+1
return "Updated"
api = {"isSuccessful": True}
except:
api = {"isSuccessful": False}
return api
@frappe.whitelist()
def feedback(args, request):
if args == "get_user_feedback":
api = frappe.db.get_list(
"User Feedback",
fields=["name", "status", "feedback_type", "date", "user_name","attachment","description","date"],
fields=["name", "status", "feedback_type", "date",
"user_name", "attachment", "description", "date"],
)
for i in api:
if i["status"] == "Active":
@ -117,19 +122,20 @@ def feedback(args,request):
else:
i["status"] = False
return api
elif args == "post_user_feedback":
request = json.loads(request)
usr_fdbk = frappe.new_doc('User Feedback')
usr_fdbk.subject = request["Subject"]
usr_fdbk.feedback_type = request["FeedbackType"]
user_name = request["UserName"]
usr_id = frappe.db.get_value('App Users', {'user_id': user_name }, ['name'])
usr_id = frappe.db.get_value(
'App Users', {'user_id': user_name}, ['name'])
usr_fdbk.user_name = usr_id
usr_fdbk.status = "Open"
usr_fdbk.description = request["Description"]
usr_fdbk.date = request["Date"]
usr_fdbk.save()
return usr_fdbk.name
@frappe.whitelist()
@ -156,6 +162,7 @@ def model_hit(args,request):
except:
return {"isSuccessful": False}
@frappe.whitelist()
def model_usage(args, request):
if args == "model_usage":
@ -178,9 +185,9 @@ def model_usage(args,request):
model_usage.sub_system_id = i['SubSystemID']
model_usage.procedure_id = i['ProcedureID']
model_usage.steps_id = i['StepsID']
model_usage.save()
model_usage.menu_id = i['MenuID']
model_usage.language = i['Language']
model_usage.insert(ignore_if_duplicate=True, ignore_mandatory=True)
return {"isSuccessful": True}
except:
return {"isSuccessful":False}
# return request

105
smart_service/apis/app_user_login.py

@ -14,7 +14,6 @@ def app_user_validation(usr, pwd):
preference=frappe.get_last_doc('App Preference')
mahindra_login=preference.mahindra_login_api
technician_login=preference.technician_login_api
# return preference
data = {'LoginID': usr, 'Password': pwd}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
if technician_login==1 and mahindra_login==0:
@ -30,10 +29,12 @@ def app_user_validation(usr, pwd):
doc = frappe.get_doc("Fish", None)
tok = doc.apple
dicData['token'] = tok
dicData['status']=1
# return decoded1
return dicData
else:
return "Invalid Credentials"
message_to_send={'status':0,'error':'Invalid Credentials'}
return message_to_send
elif technician_login==0 and mahindra_login==1:
response1 = requests.post("http://www.mahindramile.com/WindowAuth/Service.asmx/ValidateCredential", data=data, headers=headers)
decoded1 = response1.content.decode('utf-8')
@ -66,38 +67,19 @@ def app_user_validation(usr, pwd):
user_name = None
msgDic = {}
# try:
# success_msg = dictValue['children']['IsSuccessfull']['text']
# user_name = dictValue['children']['UserName']['text']
# except:
# success_msg = node.text
# if success_msg == 1:
# msgDic.update({'UserName': user_name})
# dicdata['FirstName']= user_name
# msgDic.update({'IsSuccessfull': success_msg})
# doc = frappe.get_doc("Fish", None)
# tok = doc.apple
# dicData['token'] = tok
# return dicData
# else:
# msgDic.update({'IsSuccessfull': success_msg})
# return "Invalid Credentials"
# data = {'LoginID': 'klincy-cont', 'Password': 'SmFuIU1haGlAMjI='}
# msgDic = {}
try:
msgDic['UserName'] = dictValue['children']['UserName']['text']
msgDic['IsSuccessfull'] = dictValue['children']['IsSuccessfull']['text']
doc = frappe.get_doc("Fish", None)
tok = doc.apple
dicData['token'] = tok
dicData['status']=1
return dicData
except:
msgDic['IsSuccessfull'] = node.text
return "Invalid Credentials"
message_to_send={'status':0,'error':'Invalid Credentials'}
return message_to_send
elif technician_login==1 and mahindra_login==1:
response = requests.post(
@ -112,23 +94,22 @@ def app_user_validation(usr, pwd):
dicData={
"ID": "",
"LoginName": usr,
"FirstName": "",
"FirstName": usr,
"LastName": "",
"IsActive": "True",
"UserType": "",
"UserType": "Mahindra User",
"SkillID": "",
"SkillName": "",
"UserTypeDesc": "",
"PasswordChanged": "",
"AreaName": "",
"Zone": "",
"Code": "",
"LocationName": "",
"AreaName": "Mahindra",
"Zone": "MAhindra",
"LocationName": "Mahindra",
"ChannelNo": "",
"ServerDate": "",
"ServerTime": "",
"DealerName": "",
"EmailId": "{}@email.com".format(usr),
"DealerName": "Mahindra",
"EmailId": "{}@mahindraemail.com".format(usr),
"isLDAPAuthenticated": ""}
success_msg = None
@ -143,6 +124,7 @@ def app_user_validation(usr, pwd):
doc = frappe.get_doc("Fish", None)
tok = doc.apple
dicData['token'] = tok
dicData['status']=1
return dicData
else:
@ -152,11 +134,14 @@ def app_user_validation(usr, pwd):
doc = frappe.get_doc("Fish", None)
tok = doc.apple
dicData['token'] = tok
dicData['status']=1
return dicData
except:
return "Invalid Credentials"
message_to_send={'status':0,'error':'Invalid Credentials'}
return message_to_send
else:
return "Login Blocked"
message_to_send={'status':0,'error':'Login Blocked'}
return message_to_send
def xml_to_dict(node):
@ -167,10 +152,6 @@ def xml_to_dict(node):
@frappe.whitelist()
def grant_user_access(userdata,iid):
# app_preference=frappe.db.get_last_doc("App Preference", filters={'active':'Active'})
# app_preference=frappe.db.get_list("App Preference", filters={'active':'Active'},fields=['name','application_server_url','update_server_url','asset_url','mahindra_login_api','technician_login_api','remarks','active'])
user_details = {}
userdata = json.loads(userdata)
user_id=userdata['ID']
@ -233,19 +214,16 @@ def grant_user_access(userdata,iid):
app_user.save()
'''Inserting Device data'''
# if frappe.db.exists({'doctype':'App Device','device_id' : device_id}):
if iid=='None' or iid=='null':
app_device = frappe.new_doc('App Device')
app_device.device_id = device_id
app_device.publish_type="Global"
# app_device.user_name = email
# app_device.user_type = user_type_desc
app_device.device_type = device_type
app_device.os = os
app_device.os_version = os_version
app_device.app_current_version = app_current_version
app_device.last_login = now()
app_device.insert(ignore_mandatory=True)
app_device.insert(ignore_if_duplicate=True)
if frappe.db.exists({'doctype':'App Device','device_id' : device_id}):
app_user1=frappe.get_last_doc('App Users', filters={"email_id": email})
@ -257,8 +235,8 @@ def grant_user_access(userdata,iid):
app_logs.latitude = latitude
app_logs.longitude = longitude
app_logs.date_time_stamp = now()
app_logs.save()
# return app_user1.name
app_logs.insert()
else:
app_user1=frappe.get_last_doc('App Users', filters={"email_id": email})
app_device1=frappe.get_last_doc('App Device', filters={"device_id": device_id})
@ -270,16 +248,15 @@ def grant_user_access(userdata,iid):
app_logs.longitude = longitude
app_logs.date_time_stamp = now()
app_logs.save()
# return app_user1.name
else :
# app_device = frappe.get_doc('App Device', iid)
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_user2=frappe.get_last_doc('App Users', filters={"email_id": email})
app_logs = frappe.new_doc('App Log')
app_logs.user = app_user.name
app_logs.user = app_user2.name
app_logs.device = iid
app_logs.type = 'Logged in'
app_logs.latitude = latitude
@ -289,10 +266,10 @@ def grant_user_access(userdata,iid):
''' create user with role system manager '''
if frappe.db.exists('User', email):
user = frappe.get_doc('User', email)
token = generate_keys(email)
# user = frappe.get_doc('User', email)
docu = frappe.get_doc("Fish", None)
token = docu.apple
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 {}.`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:
@ -303,15 +280,16 @@ def grant_user_access(userdata,iid):
return "Login Failure"
else:
user = frappe.new_doc('User')
user.email = email
user.first_name = first_name
user.send_welcome_email = 0
user.user_type = 'Website User'
user.add_roles('_Admin')
user.save()
token = generate_keys(email)
# user = frappe.new_doc('User')
# user.email = email
# user.first_name = first_name
# user.send_welcome_email = 0
# user.user_type = 'Website User'
# user.add_roles('_AppUser')
# user.save()
docu = frappe.get_doc("Fish", None)
token = docu.apple
user_details['token'] = token
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)
@ -332,3 +310,12 @@ def generate_keys(user):
user_details.save()
token = user_details.api_key+':'+api_secret
return token
@frappe.whitelist()
def login_generate_token(doc=None,method=None):
new_tok = generate_keys('cms@guidedsmartservice.com')
water = frappe.get_doc("Fish", None)
water.apple = new_tok
water.save()
return water.apple

21
smart_service/apis/master_api.py

@ -218,6 +218,9 @@ def masters(args, LSD):
elif args == "baseurl":
api = frappe.utils.get_url()
else:
api='No such function. Check argument: args'
return api
@ -227,24 +230,6 @@ def labels_json():
"""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 = []
# labels = set()
# for i in labels_lst:
# if i['name'] != None:
# labels.add(i['element'])
# for j in labels:
# temp_lst = []
# temp_dict = []
# for k in labels_lst:
# if j == k['element'] and k['lang'] == 'en':
# temp = k
# elif j == k['element'] and k['lang'] != 'en':
# temp_lst.append(k)
# temp['Translations'] = temp_lst
# temp_dict.append(temp)
# final.append(temp)
# # x = json.dumps(final)
# # frappe.msgprint(str(final))
return labels_lst

70
smart_service/apis/publish_api.py

@ -1,17 +1,19 @@
# Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
from traceback import FrameSummary
import frappe
from frappe.model.document import Document
import json
import frappe.utils
import os
from frappe.utils import cstr
current_db_name = frappe.conf.get("db_name")
class Publish(Document):
pass
site_name = cstr(frappe.local.site)
base_url = os.path.expanduser("~") + "/frappe-bench/sites/"+site_name+"/public"
list1 = []
@ -26,29 +28,33 @@ def get_parent_map(input_list, parameter):
for i in parentChildMap[p]:
del i['procedure_name']
del i['idx']
# if i['content_type'] == 'File':
# i['content'] = list(i['content'].split(','))
# i['file'] = [f for f in i['file'].split(',')]
# i['display_order'] = [int(n) for n in i['display_order'].split(',')]
return list1
@frappe.whitelist()
def api_procedure(args, vehicle, language, version):
x = json_grouping(args, language)
with open(base_url + "/files/json_files/%s-%s_v%s.json" % (vehicle, language, version), 'w') as f:
json.dump(x, f)
list1 = frappe.db.sql(
'''SELECT procedure_link, system, sub_system FROM %s.`tabPublish_Docs` WHERE parent='%s'; ''' % (current_db_name, args),
as_dict=True)
for d in list1:
frappe.db.sql(
"""UPDATE %s.`tabSystem Mapping_Sub System` SET procedure_status = '%s', procedure_is_published='1' where procedure_status = '%s' and `tabSystem Mapping_Sub System`.procedure='%s' and systems='%s' and sub_systems='%s' """ % (
current_db_name, 'Published', 'Publish Ready', d['procedure_link'], d['system'], d['sub_system']))
frappe.db.commit()
file_name = "/public/files/json_files/%s-%s_v%s.json" % (vehicle, language, version)
# 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)
return file_name
def json_grouping(args, language):
docs_child = frappe.db.get_list('Publish_Docs', filters={'parent': args, 'procedure_status': 'Publish Ready'}, fields=[
'variant_mapping', 'system', 'sub_system', 'procedure_status', 'procedure_link'])
docs_child = frappe.db.get_list('Publish_Docs', filters={'parent': args},
fields=['variant_mapping', 'system', 'sub_system', 'procedure_status','procedure_link'])
# lang = frappe.db.get_list('Publish', filters={'name': args}, fields=['language'])
lang = {'language': language}
variant = set()
system = {}
@ -75,19 +81,18 @@ def json_grouping(args, language):
subsystem[i] = temp_set
final = []
final_count = {}
count = 0
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, active_status
FROM %s.`tabVariant Mapping` WHERE name ='%s' ; ''' % (current_db_name,d), as_dict=True)
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 %s.`tabVariant Mapping_Assets` where category<>'Technical Manual' and parent='%s' and language='%s';''' % (
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]
@ -102,24 +107,28 @@ def json_grouping(args, language):
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,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)
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)
if len(sys)>0:
sys = sys[0]
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 {3}.`tabSystem Mapping_System Assets` where parent like '{0}%' and language='{1}' and systems='{2}';''' .format(
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,
`tabSystem Mapping_Sub System`.active_status
`tabSystem Mapping_Sub System`.active_status,`tabSystem Mapping_Sub System`.cover_image
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)
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'] == 'Active':
@ -128,13 +137,15 @@ def json_grouping(args, language):
subsys['active_status'] = False
kms = frappe.db.sql(
'''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)
'''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 {}.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)
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')
@ -144,7 +155,8 @@ def json_grouping(args, language):
subsys['Procedure_details'] = k['Procedure_details']
stepcount = frappe.db.sql(
'''SELECT count(*) as Stepcount FROM {1}.tabProcedure_Details where parent='{0}';'''.format(k['procedure_link'],current_db_name), 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'])
@ -155,8 +167,6 @@ def json_grouping(args, language):
variant_out['Variant']['Systems'] = system_out
final.append(variant_out)
# final_count['StepCount'] = count
# final.append(final_count)
frappe.db.sql(""" UPDATE %s.tabPublish SET publish_status = '%s' where name = '%s' """ % (
current_db_name, 'Published', args))
frappe.db.commit()

41
smart_service/apis/testPublish.py

@ -1,41 +0,0 @@
import frappe
from frappe.model.document import Document
import json
import os
current_db_name = frappe.conf.get("db_name")
@frappe.whitelist()
def check_vehicle_update(vehicle_list):
Vehicle_req_list = []
response = {}
v_list = json.loads(vehicle_list)
vehi = v_list['Vehicle']
iid = v_list['InstallationId']
vehicle_data = v_list['VehicleReqList']
publish_type = frappe.db.sql(
'''SELECT publish_type FROM {}.`tabApp Device` where name='{}';'''.format(current_db_name,iid), as_list=True)
creation_times = []
publish_list = []
if publish_type[0][0] != None:
publish_type = publish_type[0][0]
for v in vehicle_data:
l_id = v['LanguageID']
current_version = v['CurrentVersion']
# version_creation_time = frappe.db.sql(''' select creation FROM {}.tabPublish where version = '{}' and language= '{}';'''.format(current_db_name,current_version,l_id))
# publish_data = frappe.db.sql('''select name,version from {}.tabPublish where vehicle= '{}' and language='{}' and version > {} and publish_type= '{}' and vehicle_status = 'Active';'''
# .format(current_db_name,v,l_id,current_version,l_id),as_dict=True)
publish_data = frappe.db.sql(''' select name,version from {}.tabPublish where vehicle= '{}' and language='{}' and version > {} and publish_type= '{}' and vehicle_status = 'Active';
'''.format(current_db_name,vehi,l_id,current_version,publish_type),as_dict= True)
# for d in publish_data:
publish_list.append(publish_data)
return publish_list

18
smart_service/apis/transaction_api.py

@ -1,22 +1,22 @@
import frappe
from frappe.model.document import Document
import json
import os
from frappe.utils import cstr
current_db_name = frappe.conf.get("db_name")
site_name = cstr(frappe.local.site)
base_url = os.path.expanduser("~") + "/frappe-bench/sites/"+site_name+"/public"
@frappe.whitelist()
def get_technical_manual(args):
# request = json.loads(args)
# vehicle=request["Vehicle"]
# variant = request["Variant"]
# fuel = request["Fuel"]
# transmission = request["Transmission"]
# drive = request["Drive"]
# 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 {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:
file_size = os.path.getsize(base_url+i['file'])
i['file_size']=file_size
if i["active_status"] == "Active":
i["active_status"] = True
else:

288
smart_service/apis/update_validation.py

@ -2,9 +2,14 @@ import frappe
from frappe.model.document import Document
import json
import os
from frappe.utils import cstr
current_db_name = frappe.conf.get("db_name")
site_name = cstr(frappe.local.site)
base_url = os.path.expanduser("~") + "/frappe-bench/sites/"+site_name+"/public"
@frappe.whitelist()
def check_all_vehicle_updates(vehicle_list):
Vehicle_req_list = []
@ -19,15 +24,18 @@ def check_all_vehicle_updates(vehicle_list):
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 {}.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)
data1 = frappe.db.sql('''SELECT name,max(version) as version,vehicle_id,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 {}.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 = frappe.db.sql('''SELECT name,CAST(version AS DECIMAL(10,2)) as version,vehicle_id,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'
@ -35,8 +43,6 @@ def check_all_vehicle_updates(vehicle_list):
data_append.append(d)
Vehicle_req_list.append(data_append)
response['LanguageID'] = lang
# response['VehicleReqList'] = Vehicle_req_list[0]
# return response
if len(Vehicle_req_list) != 0:
response['VehicleReqList'] = Vehicle_req_list[0]
return response
@ -46,79 +52,235 @@ def check_all_vehicle_updates(vehicle_list):
return 'Invalid Publish Details'
def get_parent_map(input_list, parameter):
parentChildMap = {}
for b in input_list:
parentChildMap.setdefault(b[parameter] or None, []).append(b)
list1 = []
for p in parentChildMap:
da = {"procedure_name": p, 'steps': parentChildMap[p]}
list1.append(da)
for i in parentChildMap[p]:
del i['procedure_name']
del i['idx']
return list1
@frappe.whitelist()
def check_vehicle_update(vehicle_list):
Vehicle_req_list = []
try:
response = {}
v_list = json.loads(vehicle_list)
vehi = v_list['Vehicle']
iid = v_list['InstallationId']
vehicle_data = v_list['VehicleReqList']
publish_type = frappe.db.sql(
'''SELECT publish_type FROM {}.`tabApp Device` where name='{}';'''.format(current_db_name,iid), as_list=True)
req_list = json.loads(vehicle_list)
vehicle = req_list['Vehicle']
iid = req_list['InstallationId']
vehicle_data = req_list['VehicleReqList']
publish_type = frappe.db.get_list('App Device', filters={'name': iid}, fields='publish_type')
if publish_type[0][0] != None:
if len(publish_type) > 0:
publish_type = publish_type[0]['publish_type']
Vehicle_req_list = []
for v in vehicle_data:
appendList = []
appendDict = {}
variant = set()
system = {}
subsystem = {}
procedure = {}
list1 = []
list2 = []
l_id = v['LanguageID']
current_version = float(v['CurrentVersion'])
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)
current_version = v['CurrentVersion']
if publish_type == 'Internal':
publish_data = frappe.db.sql('''select name,CAST(version AS DECIMAL(10,2)) as version from {}.tabPublish where vehicle= '{}' and language='{}' and publish_type= '{}' and version > {} and vehicle_status = 'Active';
'''.format(current_db_name, vehicle, l_id, publish_type, current_version), as_dict=True)
else:
publish_data = frappe.db.sql('''select name,version from {}.tabPublish where vehicle= '{}' and language='{}' and publish_type= '{}' and version > {} and vehicle_status = 'Active';
'''.format(current_db_name, vehicle, l_id, publish_type, current_version), as_dict=True)
if data1[0]['name'] != None:
if data1[0]['version'] != None:
if current_version == float(data1[0]['version']):
data1[0]['IsUpdateAvailable'] = "false"
Vehicle_req_list.append(data1)
if len(publish_data) > 0:
update_version = publish_data[-1]['version']
for d in publish_data:
publish_docs = frappe.db.get_list('Publish_Docs', filters={'parent': d['name']},
fields=['variant_mapping', 'system', 'sub_system',
'procedure_link', 'procedure_status'])
if publish_docs != None:
list1.append(publish_docs)
for d in list1:
for f in d:
list2.append(f)
# Sort data according to variant, system and sub system
for d in list2:
variant.add(d['variant_mapping'])
for d in variant:
temp = set()
for j in list2:
if j['variant_mapping'] == d:
temp.add(j['system'])
system[d] = temp
for d in variant:
temp_set = {}
for j in system[d]:
temp = set()
for k in list2:
if d == k['variant_mapping'] and j == k['system']:
temp.add(k['sub_system'])
temp_set[j] = temp
subsystem[d] = temp_set
for d in variant:
temp_set = {}
for i in system[d]:
temp_dict = {}
for j in subsystem[d][i]:
temp_sub = set()
for k in list2:
if k['variant_mapping'] == d and k['system'] == i and k['sub_system'] == j:
temp_sub.add(k['procedure_link'])
temp_dict[j] = temp_sub
temp_set[i] = temp_dict
procedure[d] = temp_set
appendList.append(procedure)
for g in appendList:
for f in g.keys():
appendDict[f] = (g[f])
final = []
count = 0
active_status_case = "CASE WHEN active_status = 'Active' THEN 'True' ELSE 'False' END AS active_status"
for d in appendDict:
variant_out = {}
# Variant data
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 %s.`tabVariant Mapping_Assets` where category<>'Technical Manual' and parent='%s' and language='%s';''' % (
active_status_case, current_db_name, d, l_id), as_dict=True)
vari = vari[0]
if vari['active_status'] == 'Active':
vari['active_status'] = True
else:
if publish_type[0][0] == 'Internal':
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)
vari['active_status'] = False
vari['Assets'] = var_asset
variant_out['Variant'] = vari
# System data
system_out = []
for i in appendDict[d]:
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 {0}.tabSystems inner join {0}.`tabSystem Mapping_Sub System` on tabSystems.system_name = `tabSystem Mapping_Sub System`.systems where system_name = '{1}' group by system_name ;'''
.format(current_db_name, i), as_dict=True)
if len(sys) > 0:
sys = sys[0]
if sys['active_status'] == 'Active':
sys['active_status'] = True
else:
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)
sys['active_status'] = False
# System Assets
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, l_id, i, current_db_name), as_dict=True)
sys['Assets'] = sysassets
list1 = []
dict1 = {}
# Sub system
subsystem_out = []
for j in appendDict[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,
`tabSystem Mapping_Sub System`.active_status,`tabSystem Mapping_Sub System`.cover_image
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, l_id, current_db_name), as_dict=True)
base_url = '/home/frappe_srv_01/frappe-bench/sites/ss.hnsonline.com/public'
for d in data:
ver = str(d['version'])
file_name = 'files/json_files/'+vehi + "-" + \
d['language'] + '_v' + ver + '.json'
json_data = json.load(
open(os.path.join(base_url, file_name)))
json_data[0]['version'] = ver
list1.append(json_data[0])
dict1['JSON'] = list1
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))
# 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)
if len(subsys) > 0:
subsys = subsys[0]
if subsys['active_status'] == 'Active':
subsys['active_status'] = True
else:
# res = {'Language': l_id, 'IsUpdateAvailable': 'false', 'CurrentVersion': float(current_version)}
Vehicle_req_list.append({'Language': l_id, 'IsUpdateAvailable': 'false', 'CurrentVersion': float(current_version)})
subsys['active_status'] = False
kms = frappe.db.sql(
'''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
response['Vehicle'] = vehi
for k in appendDict[d][i][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 {}.tabProcedure_Details
where parent ='{}' group by procedure_name,step_name,content_type,content order by idx asc; '''.format(
current_db_name, k), as_dict=True)
temp_data = get_parent_map(proc_details, 'procedure_name')
procedure_status = frappe.db.sql(
'''SELECT workflow_state FROM {1}.tabProcedure where name='{0}';'''.format(
k, current_db_name))
procedure_status = procedure_status[0][0]
subsys['procedure_link'] = k
subsys['procedure_status'] = procedure_status
subsys['Procedure_details'] = temp_data
stepcount = frappe.db.sql(
'''SELECT count(*) as Stepcount FROM {1}.tabProcedure_Details where parent='{0}';'''.format(
k, 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['Variant']['Systems'] = system_out
final.append(variant_out)
res = {'Name': '%s-%s_%s' % (iid, vehicle, l_id), 'Language': l_id, 'IsUpdateAvailable': 'true',
'CurrentVersion': float(current_version), 'Version': float(update_version)}
try:
file_name = "/files/json_files/temp/%s-%s_%s.json" % (iid, vehicle, l_id)
dicfinal = {'JSON': final}
with open(base_url + file_name, 'w') as outfile:
outfile.write(json.dumps(dicfinal))
file_size = os.path.getsize(base_url+file_name)
res['JsonURL'] = file_name
res['FileSize'] = file_size
res['Error'] = None
except:
res['JsonURL'] = None
res['FileSize'] = None
res['Error'] = 'File failed to save'
Vehicle_req_list.append(res)
else:
Vehicle_req_list.append(
{'Language': l_id, 'IsUpdateAvailable': 'false', 'CurrentVersion': float(current_version)})
response['Vehicle'] = vehicle
response['VehicleReqList'] = Vehicle_req_list
return response
else:
Vehicle_req_list.append({'Error': 'Publish type error'})
return Vehicle_req_list
response['JSON']="Error"
return response
except:
response['JSON'] = {"Error":"Input Error"}
return response
@frappe.whitelist()
def update_completed(FileName):
try:
os.remove(base_url+ FileName)
return {'isSuccessful':True}
except:
return {'isSuccessful':True}

43
smart_service/fixtures/custom_field.json

@ -0,0 +1,43 @@
[
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": null,
"columns": 0,
"default": null,
"depends_on": null,
"description": null,
"docstatus": 0,
"doctype": "Custom Field",
"dt": "User",
"fetch_from": null,
"fieldname": "pwd",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"insert_after": "new_password",
"label": "PWD",
"name": "User-pwd",
"no_copy": 0,
"options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": null,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"translatable": 0,
"unique": 0,
"width": null
}
]

27
smart_service/hooks.py

@ -43,6 +43,7 @@ website_context = {
# page_js = {"page" : "public/js/file.js"}
# include js in doctype views
# doctype_js = {"doctype" : "public/js/doctype.js"}
# doctype_list_js = {"doctype" : "public/js/doctype_list.js"}
# doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"}
@ -93,42 +94,48 @@ website_context = {
# ---------------
# Override standard doctype classes
# override_doctype_class = {
override_doctype_class = {
# "ToDo": "custom_app.overrides.CustomToDo"
# }
}
# Document Events
# ---------------
# Hook on document methods and events
# doc_events = {
doc_events = {
"User":{
# "onload":"smart_service.masters.doctype.vehicle.vehicle.test"
}
# "*": {
# "on_update": "method",
# "on_cancel": "method",
# "on_trash": "method"
# }
# }
}
# Scheduled Tasks
# ---------------
# scheduler_events = {
scheduler_events = {
# "all": [
# "smart_service.tasks.all"
# ],
# "daily": [
# "smart_service.tasks.daily"
# ],
# "hourly": [
"hourly": [
#"smart_service.tasks.hourly"
# ],
"smart_service.masters.doctype.vehicle.vehicle.test"
#"smart_service.apis.app_user_login.login_generate_token"
#"frappe.website.doctype.web_page.web_page.login"
]
# "weekly": [
# "smart_service.tasks.weekly"
# ]
# "monthly": [
# "smart_service.tasks.monthly"
# ]
# }
}
# Testing
# -------
@ -184,4 +191,8 @@ user_data_fields = [
# auth_hooks = [
# "smart_service.auth.validate"
# ]
fixtures = [
"Custom Field",
"Property Setter"
]

2
smart_service/mahindra_smart_service/doctype/release/release.js

@ -2,6 +2,4 @@
// For license information, please see license.txt
frappe.ui.form.on('Release', {
// refresh: function(frm) {
// }
});

4
smart_service/mahindra_smart_service/doctype/release/release.py

@ -13,8 +13,4 @@ class Release(Document):
@frappe.whitelist()
def api_vehicle_map():
doc = frappe.get_doc('Systems','Reverse Parking Assistance System')
# doc = frappe.get_doc({
# 'doctype': 'Procedure',
# 'name': 'Thar-AX-0001-Air Filter Element Clean-en'
# })
return doc

1
smart_service/mahindra_smart_service/report/_applog_translation/_applog_translation.js

@ -13,7 +13,6 @@ frappe.query_reports["_Applog Translation"] = {
default: frappe.datetime.year_start(),
"reqd": 0
},
{
"fieldname":"to_date",
"label": __("To Date"),

5
smart_service/mahindra_smart_service/report/_applog_translation/_applog_translation.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-10 10:44:02.371299",
"modified": "2022-01-28 15:18:14.220575",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "_Applog Translation",
@ -21,9 +21,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

3
smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.js

@ -4,17 +4,14 @@
frappe.query_reports["_Drive Translation"] = {
"filters": [
],
"formatter": function (value, row, column, data, default_formatter) {
console.log(value)
if(value==null){
value=' '
column.align='left';
}
value = default_formatter(value, row, column, data);
return value;
}
};

8
smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2021-11-29 12:15:09.820884",
"modified": "2022-01-28 15:19:38.891878",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "_Drive Translation",
@ -19,14 +19,8 @@
"report_name": "_Drive Translation",
"report_type": "Script Report",
"roles": [
{
"role": "_Admin"
},
{
"role": "System Manager"
},
{
"role": "_Master Read"
}
]
}

81
smart_service/mahindra_smart_service/report/_drive_translation/_drive_translation.py

@ -19,7 +19,6 @@ def get_data():
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 %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
@ -35,8 +34,6 @@ def get_data():
`tabDrive`.modified as "Modified On",
`tabDrive`.active_status as "Status",
`tabDrive`.drive as 'Drive'
%s
From %s.`tabDrive`
LEFT JOIN %s.`tabTranslation` as tabTrans
@ -52,96 +49,18 @@ def get_data():
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)
return data
# data = frappe.db.sql(
# """Select
# `tabDrive Segment`.modified as "Modified On",
# `tabDrive Segment`.active_status as "Status",
# `tabDrive Segment`.drive_segment as 'drive Segment' ,
# `tabDrive Segment`.drive_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabDrive Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`tabDrive Segment`.drive_segment = tabTrans.source_text
# LEFT JOIN (Select tabLang.languageCode as languageCode
# ,_d6463952657fa86c.tabTranslation.source_text as sourceText
# , _d6463952657fa86c.tabTranslation.translated_text as translated_text
# , (CASE WHEN tabLang.languageCode = "en" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en
# , (CASE WHEN tabLang.languageCode = "gu" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu
# , (CASE WHEN tabLang.languageCode = "hi" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi
# , (CASE WHEN tabLang.languageCode = "kn" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn
# , (CASE WHEN tabLang.languageCode = "ml" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml
# , (CASE WHEN tabLang.languageCode = "mr" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr
# , (CASE WHEN tabLang.languageCode = "ta" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta
# , (CASE WHEN tabLang.languageCode = "te" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te
# From _d6463952657fa86c.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 Segment`.drive_segment = tabTranslation.sourceText;""",as_list=True)
# return data
def get_columns():
columns = []
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 %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")
# frappe.msgprint(str(lang))
columns += lang
return columns,lang
# customLang = ['en', 'hi', 'ta', 'te']
# queryAppendLang = []
# for d in customLang:
# # print(d)
# query = " ,(CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" % (d, d)
# queryAppendLang.append(query)
# actualQuery = """Select
# `tabDrive Segment`.modified as "Modified On",
# `tabDrive Segment`.active_status as "Status",
# `tabDrive Segment`.drive_segment as 'drive Segment' ,
# `tabDrive Segment`.drive_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabDrive Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`tabDrive Segment`.drive_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 From _d6463952657fa86c.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 Segment`.drive_segment = tabTranslation.sourceText;""" % (queryAppendLang[0])
# print(actualQuery)

BIN
smart_service/mahindra_smart_service/report/_file_structure/__pycache__/_file_structure.cpython-38.pyc

Binary file not shown.

8
smart_service/mahindra_smart_service/report/_file_structure/_file_structure.js

@ -8,8 +8,6 @@ const documents =['doc','docx','txt','odt','ppt','pptx'];
const spreadsheets=['ods','xls','xlsx'];
frappe.query_reports["_File Structure"] = {
"filters": [
@ -19,7 +17,6 @@ frappe.query_reports["_File Structure"] = {
if(data && column.fieldname=="filename" && data.folder==0){
if(data.private==1){
if(pictures.includes(data.fileformat)){
// console.log(data);
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 40 40">
<g id="Image" transform="translate(-2584 -2277)">
<rect id="Rectangle_1711" data-name="Rectangle 1711" width="40" height="40" transform="translate(2584 2277)" fill="none"/>
@ -93,7 +90,6 @@ frappe.query_reports["_File Structure"] = {
} else if(data.private==0){
if(pictures.includes(data.fileformat)){
// console.log(data);
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 40 40">
<g id="Image" transform="translate(-2584 -2277)">
<rect id="Rectangle_1711" data-name="Rectangle 1711" width="40" height="40" transform="translate(2584 2277)" fill="none"/>
@ -212,14 +208,10 @@ frappe.query_reports["_File Structure"] = {
},
"set_route_to_file": function (data) {
// console.log(data);
// window.open("http://ss.hnsonline.com:81/files/" + data);
window.open("http://192.168.1.58:81/files/" + data);
},
"set_route_to_folder": function (data) {
// console.log(data);
// window.open("http://ss.hnsonline.com:81/files/" + data);
},
"tree": true,

40
smart_service/mahindra_smart_service/report/_file_structure/_file_structure.py

File diff suppressed because one or more lines are too long

BIN
smart_service/mahindra_smart_service/report/_fuel_translation/__pycache__/_fuel_translation.cpython-38.pyc

Binary file not shown.

2
smart_service/mahindra_smart_service/report/_fuel_translation/_fuel_translation.js

@ -7,13 +7,11 @@ frappe.query_reports["_Fuel Translation"] = {
],
"formatter": function (value, row, column, data, default_formatter) {
console.log(value)
if(value==null){
value=' '
column.align='left';
}
value = default_formatter(value, row, column, data);
return value;
}
};

5
smart_service/mahindra_smart_service/report/_fuel_translation/_fuel_translation.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2021-11-26 17:08:23.995237",
"modified": "2022-01-28 15:18:46.419570",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "_Fuel Translation",
@ -21,9 +21,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

74
smart_service/mahindra_smart_service/report/_fuel_translation/_fuel_translation.py

@ -33,7 +33,6 @@ def get_data():
`tabFuel`.modified as "Modified On",
`tabFuel`.active_status as "Status",
`tabFuel`.fuel as 'Fuel'
%s
From `tabFuel`
LEFT JOIN `tabTranslation` as tabTrans
@ -54,41 +53,6 @@ def get_data():
return data
# data = frappe.db.sql(
# """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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
# , (CASE WHEN tabLang.languageCode = "en" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en
# , (CASE WHEN tabLang.languageCode = "gu" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu
# , (CASE WHEN tabLang.languageCode = "hi" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi
# , (CASE WHEN tabLang.languageCode = "kn" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn
# , (CASE WHEN tabLang.languageCode = "ml" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml
# , (CASE WHEN tabLang.languageCode = "mr" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr
# , (CASE WHEN tabLang.languageCode = "ta" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta
# , (CASE WHEN tabLang.languageCode = "te" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te
# From _d6463952657fa86c.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;""",as_list=True)
# return data
def get_columns():
current_db_name = frappe.conf.get("db_name")
@ -103,41 +67,3 @@ def get_columns():
lang.append(cstr(d["lang_name"])+ "::220")
columns += lang
return columns,lang
# customLang = ['en', 'hi', 'ta', 'te']
# queryAppendLang = []
# for d in customLang:
# # print(d)
# query = " ,(CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" % (d, d)
# queryAppendLang.append(query)
# actualQuery = """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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 From _d6463952657fa86c.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;""" % (queryAppendLang[0])
# print(actualQuery)

BIN
smart_service/mahindra_smart_service/report/_procedure_report/__pycache__/_procedure_report.cpython-38.pyc

Binary file not shown.

75
smart_service/mahindra_smart_service/report/_procedure_report/_procedure_report.js

@ -13,16 +13,6 @@ frappe.query_reports["_Procedure Report"] = {
],
"formatter": function (value, row, column, data, default_formatter) {
// if (data && column.fieldname == "procedure_name") {
// if (data.indent != 0 && data.indent != 1) {
// column.link_onclick = "frappe.query_reports['_Procedure Report'].set_route(" + JSON.stringify(data.parent) + ")"
// }
// else {
// column.link_onclick = " "
// }
// }
if (data && column.fieldname == "procedure_name") {
switch (data.indent) {
case 3:
@ -34,7 +24,7 @@ frappe.query_reports["_Procedure Report"] = {
<path id="Path_2564" data-name="Path 2564" d="M408.471,1492.3q3.1,0,6.2,0a1.181,1.181,0,0,1,.6.07.787.787,0,0,1,.363.547c-.011.178-.248.379-.432.5-.124.078-.329.035-.5.035q-6.259,0-12.519,0c-.168,0-.377.042-.5-.039a.913.913,0,0,1-.413-.513.7.7,0,0,1,.329-.513,1.187,1.187,0,0,1,.6-.082Q405.341,1492.3,408.471,1492.3Z" transform="translate(-33.442 -80.228)" fill="#606060"/>
<path id="Path_2565" data-name="Path 2565" d="M408.413,1528.122c-2.143,0-4.287,0-6.43,0-.412,0-.811-.053-.817-.546s.38-.615.828-.614q6.374.008,12.747,0c.453,0,.83.118.816.623s-.415.539-.827.538C412.625,1528.118,410.519,1528.122,408.413,1528.122Z" transform="translate(-33.341 -111.024)" fill="#606060"/>
<path id="Path_2566" data-name="Path 2566" d="M406.889,1563.014c-1.633,0-3.267-.007-4.9,0-.422,0-.8-.081-.814-.556-.012-.517.385-.6.827-.594q4.872.012,9.743,0c.411,0,.8.052.808.553.013.541-.389.6-.821.594C410.118,1563.009,408.5,1563.014,406.889,1563.014Z" transform="translate(-33.324 -142.032)" fill="#606060"/>
<path id="Path_2567" data-name="Path 2567" d="M479.649,1554.137c-.42-.235-.837-.474-1.259-.7a.175.175,0,0,1-.114-.181c-.011-.361-.026-.723-.062-1.082a.223.223,0,0,1,.119-.246c.382-.267.754-.549,1.131-.823a.141.141,0,0,0,.056-.195c-.144-.326-.286-.654-.424-.982a.141.141,0,0,0-.183-.088c-.473.092-.946.178-1.419.276l-.011,0a.154.154,0,0,1-.175-.066c-.249-.275-.5-.546-.763-.808a.188.188,0,0,1-.064-.217c.123-.464.231-.932.349-1.4a.131.131,0,0,0-.076-.173l-.354-.177q-.3-.151-.6-.3a.14.14,0,0,0-.2.042c-.3.37-.607.734-.9,1.107a.2.2,0,0,1-.221.085c-.362-.051-.727-.09-1.092-.121a.175.175,0,0,1-.174-.122c-.206-.438-.422-.874-.643-1.305a.17.17,0,0,0-.139-.077c-.362.078-.723.169-1.084.253a.122.122,0,0,0-.1.144c.008.49.01.98.023,1.47a.15.15,0,0,1-.087.155c-.316.2-.632.405-.94.62a.187.187,0,0,1-.226.022c-.432-.2-.869-.387-1.3-.582a.146.146,0,0,0-.205.055q-.306.422-.623.836a.154.154,0,0,0,.013.225c.312.359.618.724.933,1.081a.168.168,0,0,1,.045.2q-.175.536-.321,1.08a.183.183,0,0,1-.154.15c-.459.126-.914.263-1.372.394a.148.148,0,0,0-.127.174c.023.346.043.694.061,1.04a.151.151,0,0,0,.143.161c.475.076.948.159,1.423.23a.171.171,0,0,1,.159.125c.141.347.29.693.447,1.033a.165.165,0,0,1-.013.2c-.173.25-.342.5-.512.757-.1.145-.195.292-.293.436a.155.155,0,0,0,.021.226c.15.156.3.313.449.47.09.094.18.189.268.284a.137.137,0,0,0,.2.029c.172-.106.345-.209.518-.313q.362-.218.724-.438a.152.152,0,0,1,.186-.011c.119.063.237.125.357.186q.334.17.674.33a.172.172,0,0,1,.112.168c.046.482.1.964.155,1.448a.131.131,0,0,0,.134.133c.345.04.691.078,1.036.121a.163.163,0,0,0,.2-.124c.153-.45.315-.9.465-1.349a.17.17,0,0,1,.152-.134c.358-.075.715-.156,1.068-.252a.209.209,0,0,1,.243.063c.337.335.686.66,1.029.989a.131.131,0,0,0,.188.016q.433-.29.871-.572a.163.163,0,0,0,.076-.226c-.171-.445-.335-.892-.51-1.333a.167.167,0,0,1,.027-.2c.231-.3.454-.6.672-.9a.165.165,0,0,1,.182-.089c.344.045.691.078,1.036.115,0,0,0-.008,0-.013.139,0,.277,0,.415,0a.135.135,0,0,0,.157-.108q.152-.521.31-1.039A.132.132,0,0,0,479.649,1554.137Zm-6.27,1.911a3.069,3.069,0,0,1-2.075-.809c-.059-.053-.115-.11-.17-.17a3.06,3.06,0,0,1,2.166-5.136c.026,0,.052,0,.079,0s.051,0,.077,0h0a3.058,3.058,0,0,1-.079,6.115Z" transform="translate(-91.456 -128.231)" fill="#e51636"/>
<path id="Path_2567" data-name="Path 2567" d="M479.649,1554.137c-.42-.235-.837-.474-1.259-.7a.175.175,0,0,1-.114-.181c-.011-.361-.026-.723-.062-1.082a.223.223,0,0,1,.119-.246c.382-.267.754-.549,1.131-.823a.141.141,0,0,0,.056-.195c-.144-.326-.286-.654-.424-.982a.141.141,0,0,0-.183-.088c-.473.092-.946.178-1.419.276l-.011,0a.154.154,0,0,1-.175-.066c-.249-.275-.5-.546-.763-.808a.188.188,0,0,1-.064-.217c.123-.464.231-.932.349-1.4a.131.131,0,0,0-.076-.173l-.354-.177q-.3-.151-.6-.3a.14.14,0,0,0-.2.042c-.3.37-.607.734-.9,1.107a.2.2,0,0,1-.221.085c-.362-.051-.727-.09-1.092-.121a.175.175,0,0,1-.174-.122c-.206-.438-.422-.874-.643-1.305a.17.17,0,0,0-.139-.077c-.362.078-.723.169-1.084.253a.122.122,0,0,0-.1.144c.008.49.01.98.023,1.47a.15.15,0,0,1-.087.155c-.316.2-.632.405-.94.62a.187.187,0,0,1-.226.022c-.432-.2-.869-.387-1.3-.582a.146.146,0,0,0-.205.055q-.306.422-.623.836a.154.154,0,0,0,.013.225c.312.359.618.724.933,1.081a.168.168,0,0,1,.045.2q-.175.536-.321,1.08a.183.183,0,0,1-.154.15c-.459.126-.914.263-1.372.394a.148.148,0,0,0-.127.174c.023.346.043.694.061,1.04a.151.151,0,0,0,.143.161c.475.076.948.159,1.423.23a.171.171,0,0,1,.159.125c.141.347.29.693.447,1.033a.165.165,0,0,1-.013.2c-.173.25-.342.5-.512.757-.1.145-.195.292-.293.436a.155.155,0,0,0,.021.226c.15.156.3.313.449.47.09.094.18.189.268.284a.137.137,0,0,0,.2.029c.172-.106.345-.209.518-.313q.362-.218.724-.438a.152.152,0,0,1,.186-.011c.119.063.237.125.357.186q.334.17.674.33a.172.172,0,0,1,.112.168c.046.482.1.964.155,1.448a.131.131,0,0,0,.134.133c.345.04.691.078,1.036.121a.163.163,0,0,0,.2-.124c.153-.45.315-.9.465-1.349a.17.17,0,0,1,.152-.134c.358-.075.715-.156,1.068-.252a.209.209,0,0,1,.243.063c.337.335.686.66,1.029.989a.131.131,0,0,0,.188.016q.433-.29.871-.572a.163.163,0,0,0,.076-.226c-.171-.445-.335-.892-.51-1.333a.167.167,0,0,1,.027-.2c.231-.3.454-.6.672-.9a.165.165,0,0,1,.182-.089c.344.045.691.078,1.036.115,0,0,0-.008,0-.013.139,0,.277,0,.415,0a.135.135,0,0,0,.157-.108q.152-.521.31-1.039A.132.132,0,0,0,479.649,1554.137Zm-6.27,1.911a3.069,3.069,0,0,1-2.075-.809c-.059-.053-.115-.11-.17-.17a3.06,3.06,0,0,1,2.166-5.136c.026,0,.052,0,.079,0s.051,0,.077,0h0a3.058,3.058,0,0,1-.079,6.115Z" transform="translate(-91.456 -128.231)" fill="#000000"/>
</g>
</g>
</svg>&nbsp;&nbsp;&nbsp;${value}</p>`
@ -45,7 +35,7 @@ frappe.query_reports["_Procedure Report"] = {
<rect id="Rectangle_1704" data-name="Rectangle 1704" width="40" height="40" transform="translate(2581 1900)" fill="none"/>
<g id="Group_3450" data-name="Group 3450" transform="translate(3980.455 977.971)">
<path id="Path_2488" data-name="Path 2488" d="M-1366.515,938.924q-1.059-.01-2.119,0a.561.561,0,0,0-.626.633c-.007.633,0,1.266,0,1.9,0,.088,0,.177,0,.26-.56.083-.561.083-.561-.431,0-1.138-.034-2.276.014-3.412a1.8,1.8,0,0,0-1.793-1.785c-1.568.042-3.137.013-4.706.013-.088,0-.176-.008-.268-.011v-1.63a.316.316,0,0,1,.077-.031c.679,0,1.358,0,2.036-.007.492,0,.7-.217.7-.707,0-.66.005-1.321.015-1.981a.627.627,0,0,0-.689-.7c-.56,0-1.12,0-1.679,0q-3,0-6,0c-.464,0-.666.208-.667.675,0,.688,0,1.376,0,2.064,0,.449.207.648.662.652.514,0,1.027,0,1.541,0h.59V936.1h-.318c-.789,0-1.578,0-2.367,0a1.749,1.749,0,0,0-1.4.647c-.532.632-1.073,1.254-1.614,1.878-.246.284-.449.669-.762.813a2.961,2.961,0,0,1-1.11.052,1.087,1.087,0,0,1-.137,0,1.881,1.881,0,0,0-1.863,1.84c.04.418.006.843.006,1.265v.251h-1.122c0-.892-.01-1.762,0-2.632.008-.453-.206-.716-.656-.718q-1.045-.005-2.091,0c-.437,0-.646.206-.646.637q0,4.431,0,8.862a.572.572,0,0,0,.646.641q1.033,0,2.064,0c.472,0,.667-.193.669-.669,0-.8,0-1.6,0-2.394,0-.1.008-.194.013-.292h1.117c0,.531,0,1.043,0,1.554a1.832,1.832,0,0,0,1.8,1.8c.358,0,.717-.015,1.073.01a.623.623,0,0,1,.389.178c.772.872,1.529,1.758,2.292,2.638a1.585,1.585,0,0,0,1.239.562q3.564.009,7.128,0a1.7,1.7,0,0,0,1.257-.527q1.994-2.034,3.993-4.063a1.784,1.784,0,0,0,.551-1.332c0-.272,0-.544,0-.824h.564v.308c0,.615,0,1.229,0,1.844a.572.572,0,0,0,.643.647q1.059.006,2.119,0a.566.566,0,0,0,.623-.637q0-4.431,0-8.862A.574.574,0,0,0-1366.515,938.924Zm-23.059,6.2h-1.217c-.936,0-1.017.081-1.017,1.019v2.373c-.335,0-.628-.009-.92,0-.181.007-.212-.078-.211-.233.006-.513,0-1.027,0-1.54,0-1.943.008-3.887,0-5.83,0-.248.075-.321.313-.3.262.019.526,0,.818,0,0,.293,0,.556,0,.82,0,.642,0,1.283,0,1.925a.572.572,0,0,0,.642.646c.522.005,1.044,0,1.588,0Zm8.209-11.836h-.284v-1.1h6.732v1.1h-1.158c-.321,0-.642,0-.963,0-.464,0-.676.213-.677.67,0,.606,0,1.211,0,1.816v.321h-1.125c0-.171,0-.332,0-.493,0-.55.009-1.1.016-1.65a.606.606,0,0,0-.643-.661C-1380.1,933.284-1380.732,933.286-1381.365,933.285Zm14.33,14.633h-1.1v-.925c0-.422.005-.844,0-1.266a.563.563,0,0,0-.6-.605q-.812-.01-1.623,0a.557.557,0,0,0-.592.611c0,.468.014.936-.009,1.4a.723.723,0,0,1-.178.435q-2.012,2.073-4.05,4.122a.708.708,0,0,1-.454.184q-3.55.018-7.1,0a.668.668,0,0,1-.436-.217q-1.245-1.414-2.461-2.855a.743.743,0,0,0-.613-.3c-.5.006-1.009,0-1.513,0-.472-.006-.653-.183-.653-.651q0-3.275,0-6.549c0-.511.188-.688.706-.689.468,0,.936-.009,1.4.006a.784.784,0,0,0,.668-.3c.786-.921,1.585-1.831,2.366-2.755a.829.829,0,0,1,.7-.328c3.688.01,7.375.006,11.062.007.462,0,.563.1.563.566q0,2.188,0,4.376c0,.5.184.684.675.686s1.009,0,1.514,0a.564.564,0,0,0,.628-.629c0-.715,0-1.429,0-2.175h1.1Z" transform="translate(0)" fill="#606060"/>
<path id="Path_2489" data-name="Path 2489" d="M-1162.721,1084.808c-.943,0-1.82-.005-2.7.009-.084,0-.2.114-.243.2q-1.313,2.606-2.612,5.219c-.034.069-.059.142-.1.247h2.813l-1.641,4.932.054.024,4.431-6.1h-2.834Z" transform="translate(-213.288 -145.408)" fill="#e51636"/>
<path id="Path_2489" data-name="Path 2489" d="M-1162.721,1084.808c-.943,0-1.82-.005-2.7.009-.084,0-.2.114-.243.2q-1.313,2.606-2.612,5.219c-.034.069-.059.142-.1.247h2.813l-1.641,4.932.054.024,4.431-6.1h-2.834Z" transform="translate(-213.288 -145.408)" fill="#000000"/>
</g>
</g>
</svg>&nbsp;&nbsp;${value}</p>`
@ -61,34 +51,34 @@ frappe.query_reports["_Procedure Report"] = {
<g id="car" transform="translate(8.425 4.295)">
<g id="Group_550" data-name="Group 550">
<g id="Group_549" data-name="Group 549">
<path id="Path_452" data-name="Path 452" d="M-86.141,788.49l-1.6-3.759a.877.877,0,0,0-.808-.533H-95.4a.877.877,0,0,0-.808.533l-1.6,3.759a2.054,2.054,0,0,0-1.2,1.866V792.7a.881.881,0,0,0,.879.879h.289v1.463a.881.881,0,0,0,.879.879h1.174a.882.882,0,0,0,.885-.879h0V793.58h5.87v1.462a.881.881,0,0,0,.879.879h1.174a.882.882,0,0,0,.879-.879V793.58h.289a.883.883,0,0,0,.879-.879v-2.345A2.057,2.057,0,0,0-86.141,788.49Zm-9.532-3.526a.286.286,0,0,1,.272-.186h6.847a.288.288,0,0,1,.269.176l1.43,3.346H-97.108Zm.176,10.079a.29.29,0,0,1-.289.289h-1.177a.289.289,0,0,1-.289-.289h0V793.58H-95.5Zm8.5.289h-1.177a.289.289,0,0,1-.289-.289h0V793.58H-86.7v1.462h0a.291.291,0,0,1-.282.3H-87Zm1.174-2.345H-98.137a.289.289,0,0,1-.289-.289h0v-2.341a1.465,1.465,0,0,1,1.465-1.465h9.976a1.466,1.466,0,0,1,1.465,1.465V792.7h0a.29.29,0,0,1-.283.295h-.017Z" transform="translate(99.016 -784.197)" fill="#e51636"/>
<path id="Path_452" data-name="Path 452" d="M-86.141,788.49l-1.6-3.759a.877.877,0,0,0-.808-.533H-95.4a.877.877,0,0,0-.808.533l-1.6,3.759a2.054,2.054,0,0,0-1.2,1.866V792.7a.881.881,0,0,0,.879.879h.289v1.463a.881.881,0,0,0,.879.879h1.174a.882.882,0,0,0,.885-.879h0V793.58h5.87v1.462a.881.881,0,0,0,.879.879h1.174a.882.882,0,0,0,.879-.879V793.58h.289a.883.883,0,0,0,.879-.879v-2.345A2.057,2.057,0,0,0-86.141,788.49Zm-9.532-3.526a.286.286,0,0,1,.272-.186h6.847a.288.288,0,0,1,.269.176l1.43,3.346H-97.108Zm.176,10.079a.29.29,0,0,1-.289.289h-1.177a.289.289,0,0,1-.289-.289h0V793.58H-95.5Zm8.5.289h-1.177a.289.289,0,0,1-.289-.289h0V793.58H-86.7v1.462h0a.291.291,0,0,1-.282.3H-87Zm1.174-2.345H-98.137a.289.289,0,0,1-.289-.289h0v-2.341a1.465,1.465,0,0,1,1.465-1.465h9.976a1.466,1.466,0,0,1,1.465,1.465V792.7h0a.29.29,0,0,1-.283.295h-.017Z" transform="translate(99.016 -784.197)" fill="#000000"/>
</g>
</g>
<g id="Group_552" data-name="Group 552" transform="translate(1.174 5.279)">
<g id="Group_551" data-name="Group 551">
<path id="Path_453" data-name="Path 453" d="M-96.739,787.848a1.464,1.464,0,0,0-1.465,1.465,1.465,1.465,0,0,0,1.465,1.465,1.465,1.465,0,0,0,1.465-1.465A1.466,1.466,0,0,0-96.739,787.848Zm0,2.345a.879.879,0,0,1-.879-.879.879.879,0,0,1,.879-.879.88.88,0,0,1,.879.879.882.882,0,0,1-.879.879Z" transform="translate(98.204 -787.848)" fill="#e51636"/>
<path id="Path_453" data-name="Path 453" d="M-96.739,787.848a1.464,1.464,0,0,0-1.465,1.465,1.465,1.465,0,0,0,1.465,1.465,1.465,1.465,0,0,0,1.465-1.465A1.466,1.466,0,0,0-96.739,787.848Zm0,2.345a.879.879,0,0,1-.879-.879.879.879,0,0,1,.879-.879.88.88,0,0,1,.879.879.882.882,0,0,1-.879.879Z" transform="translate(98.204 -787.848)" fill="#000000"/>
</g>
</g>
<g id="Group_554" data-name="Group 554" transform="translate(9.97 5.279)">
<g id="Group_553" data-name="Group 553">
<path id="Path_454" data-name="Path 454" d="M-90.655,787.848a1.464,1.464,0,0,0-1.465,1.465,1.465,1.465,0,0,0,1.465,1.465,1.465,1.465,0,0,0,1.465-1.465A1.466,1.466,0,0,0-90.655,787.848Zm0,2.345a.879.879,0,0,1-.879-.879.879.879,0,0,1,.879-.879.88.88,0,0,1,.879.879.882.882,0,0,1-.879.879Z" transform="translate(92.12 -787.848)" fill="#e51636"/>
<path id="Path_454" data-name="Path 454" d="M-90.655,787.848a1.464,1.464,0,0,0-1.465,1.465,1.465,1.465,0,0,0,1.465,1.465,1.465,1.465,0,0,0,1.465-1.465A1.466,1.466,0,0,0-90.655,787.848Zm0,2.345a.879.879,0,0,1-.879-.879.879.879,0,0,1,.879-.879.88.88,0,0,1,.879.879.882.882,0,0,1-.879.879Z" transform="translate(92.12 -787.848)" fill="#000000"/>
</g>
</g>
<g id="Group_556" data-name="Group 556" transform="translate(4.683 7.038)">
<g id="Group_555" data-name="Group 555">
<path id="Path_455" data-name="Path 455" d="M-91.37,789.065h-4.112a.294.294,0,0,0-.295.294.294.294,0,0,0,.295.295h4.1a.294.294,0,0,0,.294-.295.294.294,0,0,0-.294-.294Z" transform="translate(95.777 -789.065)" fill="#e51636"/>
<path id="Path_455" data-name="Path 455" d="M-91.37,789.065h-4.112a.294.294,0,0,0-.295.294.294.294,0,0,0,.295.295h4.1a.294.294,0,0,0,.294-.295.294.294,0,0,0-.294-.294Z" transform="translate(95.777 -789.065)" fill="#000000"/>
</g>
</g>
<g id="Group_558" data-name="Group 558" transform="translate(4.683 5.864)">
<g id="Group_557" data-name="Group 557">
<path id="Path_456" data-name="Path 456" d="M-91.37,788.253h-4.112a.294.294,0,0,0-.295.294.294.294,0,0,0,.295.295h4.1a.294.294,0,0,0,.294-.295.294.294,0,0,0-.294-.294Z" transform="translate(95.777 -788.253)" fill="#e51636"/>
<path id="Path_456" data-name="Path 456" d="M-91.37,788.253h-4.112a.294.294,0,0,0-.295.294.294.294,0,0,0,.295.295h4.1a.294.294,0,0,0,.294-.295.294.294,0,0,0-.294-.294Z" transform="translate(95.777 -788.253)" fill="#000000"/>
</g>
</g>
</g>
</g>
<g id="Group_3056" data-name="Group 3056" transform="translate(21.591 11.364)">
<ellipse id="Ellipse_91" data-name="Ellipse 91" cx="7" cy="6.5" rx="7" ry="6.5" transform="translate(-0.477 0.136)" fill="#fff"/>
<path id="Path_2603" data-name="Path 2603" d="M-1045.072,205.021l-2.947-2.948a4.821,4.821,0,0,0,1.12-3.1,4.862,4.862,0,0,0-4.857-4.857h0a4.825,4.825,0,0,0-3.434,1.423,4.825,4.825,0,0,0-1.422,3.434,4.824,4.824,0,0,0,1.423,3.434,4.825,4.825,0,0,0,3.434,1.422,4.82,4.82,0,0,0,3.1-1.12l2.948,2.948a.447.447,0,0,0,.317.132.447.447,0,0,0,.317-.132A.449.449,0,0,0-1045.072,205.021Zm-6.684-2.091a3.933,3.933,0,0,1-2.8-1.159,3.933,3.933,0,0,1-1.16-2.8,3.933,3.933,0,0,1,1.16-2.8,3.933,3.933,0,0,1,2.8-1.16v0a3.964,3.964,0,0,1,3.959,3.959,3.933,3.933,0,0,1-1.16,2.8A3.933,3.933,0,0,1-1051.756,202.93Z" transform="translate(1058.064 -192.663)" fill="#e51636"/>
<path id="Path_2603" data-name="Path 2603" d="M-1045.072,205.021l-2.947-2.948a4.821,4.821,0,0,0,1.12-3.1,4.862,4.862,0,0,0-4.857-4.857h0a4.825,4.825,0,0,0-3.434,1.423,4.825,4.825,0,0,0-1.422,3.434,4.824,4.824,0,0,0,1.423,3.434,4.825,4.825,0,0,0,3.434,1.422,4.82,4.82,0,0,0,3.1-1.12l2.948,2.948a.447.447,0,0,0,.317.132.447.447,0,0,0,.317-.132A.449.449,0,0,0-1045.072,205.021Zm-6.684-2.091a3.933,3.933,0,0,1-2.8-1.159,3.933,3.933,0,0,1-1.16-2.8,3.933,3.933,0,0,1,1.16-2.8,3.933,3.933,0,0,1,2.8-1.16v0a3.964,3.964,0,0,1,3.959,3.959,3.933,3.933,0,0,1-1.16,2.8A3.933,3.933,0,0,1-1051.756,202.93Z" transform="translate(1058.064 -192.663)" fill="#000000"/>
</g>
</g>
</g>
@ -96,7 +86,7 @@ frappe.query_reports["_Procedure Report"] = {
</svg>&nbsp;&nbsp;${value}</p>`
break;
case 0:
value = `<p><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="18px" viewBox="0 0 24 24" width="18px" fill="#ef6d81"><g><rect fill="none" height="24" width="24" y="0"/></g><g><g><path d="M18.92,6.01C18.72,5.42,18.16,5,17.5,5h-11C5.84,5,5.29,5.42,5.08,6.01L3,12v8c0,0.55,0.45,1,1,1h1c0.55,0,1-0.45,1-1v-1 h12v1c0,0.55,0.45,1,1,1h1c0.55,0,1-0.45,1-1v-8L18.92,6.01z M6.85,7h10.29l1.04,3H5.81L6.85,7z M19,17H5v-5h14V17z"/><circle cx="7.5" cy="14.5" r="1.5"/><circle cx="16.5" cy="14.5" r="1.5"/></g></g></svg><b>&nbsp;&nbsp;${value}</b></p>`
value = `<p><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="18px" viewBox="0 0 24 24" width="18px" fill="#606060"><g><rect fill="none" height="24" width="24" y="0"/></g><g><g><path d="M18.92,6.01C18.72,5.42,18.16,5,17.5,5h-11C5.84,5,5.29,5.42,5.08,6.01L3,12v8c0,0.55,0.45,1,1,1h1c0.55,0,1-0.45,1-1v-1 h12v1c0,0.55,0.45,1,1,1h1c0.55,0,1-0.45,1-1v-8L18.92,6.01z M6.85,7h10.29l1.04,3H5.81L6.85,7z M19,17H5v-5h14V17z"/><circle cx="7.5" cy="14.5" r="1.5"/><circle cx="16.5" cy="14.5" r="1.5"/></g></g></svg><b>&nbsp;&nbsp;${value}</b></p>`
break;
default:
value = `<p>&nbsp;&nbsp;<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 40 40">
@ -104,7 +94,7 @@ frappe.query_reports["_Procedure Report"] = {
<rect id="Rectangle_1706" data-name="Rectangle 1706" width="40" height="40" transform="translate(2579 2008)" fill="none"/>
<g id="Group_3453" data-name="Group 3453" transform="translate(-4.215 -1.96)">
<circle id="Ellipse_97" data-name="Ellipse 97" cx="9" cy="9" r="9" transform="translate(2588.215 2020.96)" fill="#606060"/>
<path id="Path_2934" data-name="Path 2934" d="M6.732,17.942a.856.856,0,0,0,.68-.375,1.6,1.6,0,0,0,0-1.812L2.322,8.971l5.09-6.783a1.6,1.6,0,0,0,0-1.812.8.8,0,0,0-1.36,0L.282,8.065a1.6,1.6,0,0,0,0,1.812l5.77,7.689A.857.857,0,0,0,6.732,17.942Z" transform="translate(2617.437 2038.931) rotate(180)" fill="#e51636"/>
<path id="Path_2934" data-name="Path 2934" d="M6.732,17.942a.856.856,0,0,0,.68-.375,1.6,1.6,0,0,0,0-1.812L2.322,8.971l5.09-6.783a1.6,1.6,0,0,0,0-1.812.8.8,0,0,0-1.36,0L.282,8.065a1.6,1.6,0,0,0,0,1.812l5.77,7.689A.857.857,0,0,0,6.732,17.942Z" transform="translate(2617.437 2038.931) rotate(180)" fill="#000000"/>
</g>
</g>
</svg>&nbsp;&nbsp;&nbsp;${value}</p>`
@ -135,21 +125,52 @@ frappe.query_reports["_Procedure Report"] = {
}
}
if (data && column.fieldname == "workflow_state") {
column.link_onclick = "frappe.query_reports['_Procedure Report'].set_route(" + JSON.stringify(data.procedure) + ")"
if(data && String(column.fieldname).slice(3)=='workflow_state'){
if (value !== undefined){
value = `<span>
<svg xmlns="http://www.w3.org/2000/svg" height="18px" viewBox="0 0 24 24" width="18px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z"/></svg>
&nbsp&nbsp ${value} </span>`
var langCode = String(column.fieldname).slice(0,2)
var proc = String(data.procedure).slice(0,-2)
column.link_onclick = "frappe.query_reports['_Procedure Report'].set_route(" + JSON.stringify(proc+langCode) + ")"
}
}
if(data && String(column.fieldname).slice(2) == '_active_status'){
switch(data.indent){
case 2:
if(value !== undefined){
newValue = ""
val = String(value).split(' / ');
switch (val[0]) {
case "Active":
newValue = `<span class="filterable indicator-pill green ellipsis"> ${val[0]} </span>`
break;
case "Inactive":
newValue = `<span class="filterable indicator-pill red ellipsis"> ${val[0]} </span>`
break;
}
value = newValue +" / "+ `<span class="filterable indicator-pill red ellipsis"> ${val[1]} </span>`
}
break;
case 3:
column.align= 'center'
if (value !==undefined){
value = `<span class="filterable indicator-pill orange ellipsis"> ${value}</span>`
}
break;
}
}
value = default_formatter(value, row, column, data);
return value;
},
"set_route": function (data) {
console.log(data)
frappe.set_route("Form", "Procedure", data)
},
// "set_route_to_procedure": function (data) {
// da = "http://192.168.1.58:81/printview?doctype=Procedure&name=" + data + "&format=Standard&no_letterhead=1&letterhead=No%20Letterhead&settings=%7B%7D&_lang=en"
// window.open(da);
// },
"tree": true,
"name_field": "procedure_name",
"parent_field": "",

106
smart_service/mahindra_smart_service/report/_procedure_report/_procedure_report.py

@ -5,6 +5,10 @@ import functools
import frappe
from frappe import _
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=True)
def execute(filters=None):
validate_filters(filters)
@ -12,12 +16,14 @@ def execute(filters=None):
columns = get_columns()
return columns, data
def validate_filters(filters):
return
def get_data(filters):
fil = None
if(filters.variant_mapping!=None):
if filters.variant_mapping != None:
fil = filters.variant_mapping + "%"
data = frappe.db.sql(
@ -31,11 +37,10 @@ def get_data(filters):
inner join tabProcedure
on `tabSystem Mapping_Sub System`.`procedure` = tabProcedure.name
where `tabSystem Mapping_Sub System`.parent LIKE %s
and substring(`tabProcedure_Details`.parent,-2) = 'en'
GROUP by `tabSystem Mapping_Sub System`.`procedure` ,tabProcedure_Details.procedure_name ,tabProcedure_Details.step_name
order by `tabSystem Mapping_Sub System`.systems ,`tabSystem Mapping_Sub System`.sub_systems,`procedure`,idx;
""", fil, as_dict=True)
filterData = filters.variant_mapping
if(filterData != None and len(data) > 0):
data = modifyData(data, filterData)
@ -57,11 +62,12 @@ def modifyData(dataInput,filterParent):
ssMap, ssSize = getParentMap(sMap[i], 'sub_systems')
ssMapAppend = appendToDic2(ssMap, indent=2, header=1)
for j in ssMapAppend:
val = j['procedure_name']
proc = j['procedure']
procMap, procSize = getParentMap(ssMap[val], 'procedure_name')
procValuesDic = appendToDic3(procMap, procSize, j, indent=3, header = 0)
procValuesDic = appendToDic3(
procMap, procSize, j, indent=3, header=0, procedure=proc)
j['length'] = len(procValuesDic)
list1.append(j)
@ -78,6 +84,7 @@ def modifyData(dataInput,filterParent):
appendData = removeDuplicateAndHeader(appendData)
return appendData
def appendToDic1(mapData, parent, indent, header):
mapDataAppend = []
for d in mapData:
@ -94,6 +101,7 @@ def appendToDic1(mapData, parent, indent, header):
mapDataAppend.append(keyDict)
return mapDataAppend
def appendToDic2(mapData, indent, header):
mapDataAppend = []
for d in mapData:
@ -106,26 +114,74 @@ def appendToDic2(mapData, indent, header):
'active_status': da['active_status'],
'indent': indent,
'header': header,
'workflow_state': da['workflow_state'],
'en_workflow_state': da['workflow_state'],
'procedure': da['procedure'],
}
dic1 = {}
for c in custom_lang:
other_proc = da['procedure']
other_proc = other_proc[:-2]+c['lang_code']
others = frappe.db.sql('''select tabProcedure.active_status,count(distinct(`tabProcedure_Details`.procedure_name)) as syscount,tabProcedure.workflow_state
from (_d6463952657fa86c.`tabProcedure_Details` inner join _d6463952657fa86c.`tabProcedure` on `tabProcedure_Details`.`parent` = `tabProcedure`.`name`)
where `tabProcedure`.name = '{}'; '''.format(other_proc), as_dict=True)
if len(others) > 0:
others = others[0]
if others['active_status'] is not None:
if others['syscount'] == 1:
dic1['{}_active_status'.format(
c['lang_code'])] = others['active_status'] + ' / ' + str(others['syscount']) + ' Procedure'
else:
dic1['{}_active_status'.format(
c['lang_code'])] = others['active_status'] + ' / ' + str(others['syscount']) + ' Procedures'
dic1['{}_workflow_state'.format(
c['lang_code'])] = others['workflow_state']
keyDict.update(dic1)
mapDataAppend.append(keyDict)
return mapDataAppend
def appendToDic3(mapData,procSize,j,indent,header):
def appendToDic3(mapData, procSize, j, indent, header, procedure):
mapDataAppend = []
i = 0
dic1 = {}
list1 = []
for c in custom_lang:
list2 = []
procedure = procedure[:-2]+c['lang_code']
other_step_count = frappe.db.sql(
'''select count(distinct(step_name)) as count from _d6463952657fa86c.tabProcedure_Details where parent= '{}' group by(procedure_name) order by idx;'''.format(procedure), as_list=True)
for l in other_step_count:
list2.append(l[0])
list1.append(list2)
for u in mapData:
procDict = {
'systems': mapData[u][0]['systems'],
'sub_systems': mapData[u][0]['sub_systems'],
'parent': j["parent"],
'procedure_name': u,
'active_status': "Active",
'indent': indent,
'header': header,
'length': procSize[i]
'length': procSize[i],
}
dic2 = {}
for cus in range(len(custom_lang)):
if len(list1[cus]) > 0:
if list1[cus][i] == 1:
dic1['{}_active_status'.format(custom_lang[cus]['lang_code'])] = str(
list1[cus][i]) + " Step"
else:
dic1['{}_active_status'.format(custom_lang[cus]['lang_code'])] = str(
list1[cus][i]) + " Steps"
dic2.update(dic1)
procDict.update(dic1)
i += 1
mapDataAppend.append(procDict)
return mapDataAppend
@ -137,6 +193,7 @@ def modifyChildData(childData, indent, header):
a.update({'header': header})
return childData
def addParent(variantParent, indent, header):
varParDict = [{
'systems': "",
@ -148,6 +205,7 @@ def addParent(variantParent, indent, header):
}]
return varParDict
def getParentMap(input_list, parameter):
sizeList = []
parentChildMap = {}
@ -157,6 +215,7 @@ def getParentMap(input_list, parameter):
sizeList.append(len(parentChildMap[c]))
return parentChildMap, sizeList
def addDuplicateData(data1):
prevValue = ""
for i in data1:
@ -168,6 +227,7 @@ def addDuplicateData(data1):
prevValue = i['procedure_name']
return data1
def removeDuplicateAndHeader(data1):
for k in data1:
if k['header'] == 0:
@ -175,9 +235,6 @@ def removeDuplicateAndHeader(data1):
k['workflow_state'] = ""
return data1
def print(dataText):
frappe.msgprint(str(dataText))
def get_columns():
columns = [
@ -201,22 +258,33 @@ def get_columns():
"width": 150
},
{
"fieldname": "workflow_state",
"fieldname": "en_workflow_state",
"label": _("English"),
"fieldtype": "Link",
"options": "Procedure",
"width": 150
}
]
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)
if len(custom_lang) > 0:
lang = []
for i in custom_lang:
langField = {
"fieldname": i['lang_name'],
"label": i['lang_name'],
lang_status = {
"fieldname": "{}_active_status".format(i['lang_code']),
"label": _("{}_Status".format(i['lang_name'])),
"fieldtype": "Data",
"options": "",
"width": 150
}
lang_workflow = {
"fieldname": "{}_workflow_state".format(i['lang_code']),
"label": _("{}_workflow_state".format(i['lang_name'])),
"fieldtype": "Link",
"options": "Procedure",
"width": 150
}
lang.append(langField)
lang.append(lang_status)
lang.append(lang_workflow)
columns += lang
return columns

BIN
smart_service/mahindra_smart_service/report/_sub_systems_translation/__pycache__/_sub_systems_translation.cpython-38.pyc

Binary file not shown.

1
smart_service/mahindra_smart_service/report/_sub_systems_translation/_sub_systems_translation.js

@ -14,6 +14,5 @@ frappe.query_reports["_Sub Systems Translation"] = {
}
value = default_formatter(value, row, column, data);
return value;
}
};

5
smart_service/mahindra_smart_service/report/_sub_systems_translation/_sub_systems_translation.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2021-11-18 13:02:56.502032",
"modified": "2022-01-28 15:19:04.967839",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "_Sub Systems Translation",
@ -22,9 +22,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Author"
}
]
}

76
smart_service/mahindra_smart_service/report/_sub_systems_translation/_sub_systems_translation.py

@ -20,7 +20,6 @@ def get_data():
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 %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
@ -56,41 +55,6 @@ def get_data():
return data
# data = frappe.db.sql(
# """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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
# , (CASE WHEN tabLang.languageCode = "en" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en
# , (CASE WHEN tabLang.languageCode = "gu" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu
# , (CASE WHEN tabLang.languageCode = "hi" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi
# , (CASE WHEN tabLang.languageCode = "kn" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn
# , (CASE WHEN tabLang.languageCode = "ml" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml
# , (CASE WHEN tabLang.languageCode = "mr" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr
# , (CASE WHEN tabLang.languageCode = "ta" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta
# , (CASE WHEN tabLang.languageCode = "te" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te
# From _d6463952657fa86c.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;""",as_list=True)
# return data
def get_columns():
@ -100,47 +64,7 @@ def get_columns():
]
lang = []
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")
# frappe.msgprint(str(lang))
columns += lang
return columns,lang
# customLang = ['en', 'hi', 'ta', 'te']
# queryAppendLang = []
# for d in customLang:
# # print(d)
# query = " ,(CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" % (d, d)
# queryAppendLang.append(query)
# actualQuery = """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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 From _d6463952657fa86c.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;""" % (queryAppendLang[0])
# print(actualQuery)

BIN
smart_service/mahindra_smart_service/report/_systems_translation/__pycache__/_systems_translation.cpython-38.pyc

Binary file not shown.

1
smart_service/mahindra_smart_service/report/_systems_translation/_systems_translation.js

@ -14,6 +14,5 @@ frappe.query_reports["_Systems Translation"] = {
}
value = default_formatter(value, row, column, data);
return value;
}
};

5
smart_service/mahindra_smart_service/report/_systems_translation/_systems_translation.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2021-11-18 12:55:26.914599",
"modified": "2022-01-28 15:19:13.135158",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "_Systems Translation",
@ -22,9 +22,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Author"
}
]
}

80
smart_service/mahindra_smart_service/report/_systems_translation/_systems_translation.py

@ -19,7 +19,6 @@ def get_data():
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 %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
@ -35,8 +34,6 @@ def get_data():
`tabSystems`.modified as "Modified On",
`tabSystems`.active_status as "Status",
`tabSystems`.system_name as 'Vehicle Segment'
%s
From %s.`tabSystems`
LEFT JOIN %s.`tabTranslation` as tabTrans
@ -52,47 +49,10 @@ def get_data():
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,current_db_name)
data = frappe.db.sql(actualQuery,as_list=True)
return data
# data = frappe.db.sql(
# """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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
# , (CASE WHEN tabLang.languageCode = "en" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en
# , (CASE WHEN tabLang.languageCode = "gu" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu
# , (CASE WHEN tabLang.languageCode = "hi" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi
# , (CASE WHEN tabLang.languageCode = "kn" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn
# , (CASE WHEN tabLang.languageCode = "ml" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml
# , (CASE WHEN tabLang.languageCode = "mr" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr
# , (CASE WHEN tabLang.languageCode = "ta" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta
# , (CASE WHEN tabLang.languageCode = "te" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te
# From _d6463952657fa86c.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;""",as_list=True)
# return data
def get_columns():
columns = []
@ -101,47 +61,7 @@ def get_columns():
]
lang = []
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")
# frappe.msgprint(str(lang))
columns += lang
return columns,lang
# customLang = ['en', 'hi', 'ta', 'te']
# queryAppendLang = []
# for d in customLang:
# # print(d)
# query = " ,(CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" % (d, d)
# queryAppendLang.append(query)
# actualQuery = """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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 From _d6463952657fa86c.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;""" % (queryAppendLang[0])
# print(actualQuery)

BIN
smart_service/mahindra_smart_service/report/_transmission_translation/__pycache__/_transmission_translation.cpython-38.pyc

Binary file not shown.

1
smart_service/mahindra_smart_service/report/_transmission_translation/_transmission_translation.js

@ -14,6 +14,5 @@ frappe.query_reports["_Transmission Translation"] = {
}
value = default_formatter(value, row, column, data);
return value;
}
};

8
smart_service/mahindra_smart_service/report/_transmission_translation/_transmission_translation.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2021-11-29 12:14:17.565403",
"modified": "2022-01-28 15:18:31.653425",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "_Transmission Translation",
@ -21,12 +21,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
},
{
"role": "_Master Read"
}
]
}

81
smart_service/mahindra_smart_service/report/_transmission_translation/_transmission_translation.py

@ -17,8 +17,6 @@ def execute(filters=None):
def get_data():
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 %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
@ -34,8 +32,6 @@ def get_data():
`tabTransmission`.modified as "Modified On",
`tabTransmission`.active_status as "Status",
`tabTransmission`.transmission as 'Transmission'
%s
From %s.`tabTransmission`
LEFT JOIN %s.`tabTranslation` as tabTrans
@ -53,45 +49,8 @@ def get_data():
data = frappe.db.sql(actualQuery,as_list=True)
return data
# data = frappe.db.sql(
# """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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
# , (CASE WHEN tabLang.languageCode = "en" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en
# , (CASE WHEN tabLang.languageCode = "gu" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu
# , (CASE WHEN tabLang.languageCode = "hi" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi
# , (CASE WHEN tabLang.languageCode = "kn" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn
# , (CASE WHEN tabLang.languageCode = "ml" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml
# , (CASE WHEN tabLang.languageCode = "mr" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr
# , (CASE WHEN tabLang.languageCode = "ta" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta
# , (CASE WHEN tabLang.languageCode = "te" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te
# From _d6463952657fa86c.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;""",as_list=True)
# return data
def get_columns():
columns = []
@ -100,47 +59,7 @@ def get_columns():
]
lang = []
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")
# frappe.msgprint(str(lang))
columns += lang
return columns,lang
# customLang = ['en', 'hi', 'ta', 'te']
# queryAppendLang = []
# for d in customLang:
# # print(d)
# query = " ,(CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" % (d, d)
# queryAppendLang.append(query)
# actualQuery = """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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 From _d6463952657fa86c.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;""" % (queryAppendLang[0])
# print(actualQuery)

BIN
smart_service/mahindra_smart_service/report/_variant_translation/__pycache__/_variant_translation.cpython-38.pyc

Binary file not shown.

8
smart_service/mahindra_smart_service/report/_variant_translation/_variant_translation.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2021-11-30 12:10:32.622816",
"modified": "2022-01-28 15:17:37.387567",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "_Variant Translation",
@ -19,14 +19,8 @@
"report_name": "_Variant Translation",
"report_type": "Script Report",
"roles": [
{
"role": "_Admin"
},
{
"role": "System Manager"
},
{
"role": "_Master Read"
}
]
}

80
smart_service/mahindra_smart_service/report/_variant_translation/_variant_translation.py

@ -18,8 +18,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:
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN tabTranslation.translated_text ELSE null END) as %s" %(d[0],d[0])
@ -30,7 +28,6 @@ def get_data():
r = ",tabTranslation.%s as %s"%(d[0],d[0])
sel+= r
actualQuery = """Select
`tabVariant`.modified as "Modified On",
`tabVariant`.active_status as "Status",
@ -52,46 +49,9 @@ def get_data():
ON tabTranslation.language = tabLang.languageCode) as tabTranslation
ON `tabVariant`.variant = tabTranslation.sourceText;""" % (sel ,queryAppendLang)
data = frappe.db.sql(actualQuery,as_list=True)
return data
# data = frappe.db.sql(
# """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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
# , (CASE WHEN tabLang.languageCode = "en" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en
# , (CASE WHEN tabLang.languageCode = "gu" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu
# , (CASE WHEN tabLang.languageCode = "hi" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi
# , (CASE WHEN tabLang.languageCode = "kn" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn
# , (CASE WHEN tabLang.languageCode = "ml" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml
# , (CASE WHEN tabLang.languageCode = "mr" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr
# , (CASE WHEN tabLang.languageCode = "ta" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta
# , (CASE WHEN tabLang.languageCode = "te" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te
# From _d6463952657fa86c.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;""",as_list=True)
# return data
def get_columns():
@ -101,47 +61,7 @@ def get_columns():
]
lang = []
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")
# frappe.msgprint(str(lang))
columns += lang
return columns,lang
# customLang = ['en', 'hi', 'ta', 'te']
# queryAppendLang = []
# for d in customLang:
# # print(d)
# query = " ,(CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" % (d, d)
# queryAppendLang.append(query)
# actualQuery = """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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 From _d6463952657fa86c.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;""" % (queryAppendLang[0])
# print(actualQuery)

BIN
smart_service/mahindra_smart_service/report/_vehicle_segment_translation/__pycache__/_vehicle_segment_translation.cpython-38.pyc

Binary file not shown.

5
smart_service/mahindra_smart_service/report/_vehicle_segment_translation/_vehicle_segment_translation.json

@ -28,7 +28,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2021-11-16 15:10:52.636132",
"modified": "2022-01-28 15:19:20.751548",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "_Vehicle Segment Translation",
@ -42,9 +42,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Author"
}
]
}

76
smart_service/mahindra_smart_service/report/_vehicle_segment_translation/_vehicle_segment_translation.py

@ -54,44 +54,8 @@ def get_data():
data = frappe.db.sql(actualQuery,as_list=True)
return data
# data = frappe.db.sql(
# """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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
# , (CASE WHEN tabLang.languageCode = "en" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en
# , (CASE WHEN tabLang.languageCode = "gu" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu
# , (CASE WHEN tabLang.languageCode = "hi" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi
# , (CASE WHEN tabLang.languageCode = "kn" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn
# , (CASE WHEN tabLang.languageCode = "ml" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml
# , (CASE WHEN tabLang.languageCode = "mr" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr
# , (CASE WHEN tabLang.languageCode = "ta" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta
# , (CASE WHEN tabLang.languageCode = "te" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te
# From _d6463952657fa86c.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;""",as_list=True)
# return data
def get_columns():
@ -101,47 +65,7 @@ def get_columns():
]
lang = []
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")
# frappe.msgprint(str(lang))
columns += lang
return columns,lang
# customLang = ['en', 'hi', 'ta', 'te']
# queryAppendLang = []
# for d in customLang:
# # print(d)
# query = " ,(CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" % (d, d)
# queryAppendLang.append(query)
# actualQuery = """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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 From _d6463952657fa86c.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;""" % (queryAppendLang[0])
# print(actualQuery)

BIN
smart_service/mahindra_smart_service/report/_vehicle_translation/__pycache__/_vehicle_translation.cpython-38.pyc

Binary file not shown.

1
smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.js

@ -14,6 +14,5 @@ frappe.query_reports["_Vehicle Translation"] = {
}
value = default_formatter(value, row, column, data);
return value;
}
};

5
smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2021-11-24 16:56:50.600660",
"modified": "2022-01-28 15:18:57.499876",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "_Vehicle Translation",
@ -21,9 +21,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

81
smart_service/mahindra_smart_service/report/_vehicle_translation/_vehicle_translation.py

@ -17,8 +17,6 @@ def execute(filters=None):
def get_data():
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 %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0])
@ -34,8 +32,6 @@ def get_data():
`tabVehicle`.modified as "Modified On",
`tabVehicle`.active_status as "Status",
`tabVehicle`.vehicle as 'Vehicle'
%s
From %s.`tabVehicle`
LEFT JOIN %s.`tabTranslation` as tabTrans
@ -53,45 +49,8 @@ def get_data():
data = frappe.db.sql(actualQuery,as_list=True)
return data
# data = frappe.db.sql(
# """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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
# , (CASE WHEN tabLang.languageCode = "en" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en
# , (CASE WHEN tabLang.languageCode = "gu" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu
# , (CASE WHEN tabLang.languageCode = "hi" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi
# , (CASE WHEN tabLang.languageCode = "kn" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn
# , (CASE WHEN tabLang.languageCode = "ml" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml
# , (CASE WHEN tabLang.languageCode = "mr" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr
# , (CASE WHEN tabLang.languageCode = "ta" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta
# , (CASE WHEN tabLang.languageCode = "te" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te
# From _d6463952657fa86c.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;""",as_list=True)
# return data
def get_columns():
columns = []
@ -100,47 +59,7 @@ def get_columns():
]
lang = []
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")
# frappe.msgprint(str(lang))
columns += lang
return columns,lang
# customLang = ['en', 'hi', 'ta', 'te']
# queryAppendLang = []
# for d in customLang:
# # print(d)
# query = " ,(CASE WHEN tabLang.languageCode = '%s' THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as %s" % (d, d)
# queryAppendLang.append(query)
# actualQuery = """Select
# `tabVehicle Segment`.modified as "Modified On",
# `tabVehicle Segment`.active_status as "Status",
# `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' ,
# `tabVehicle Segment`.vehicle_segment as 'English',
# tabTranslation.hi as हिंदी,
# tabTranslation.ta as தமிழ்,
# tabTranslation.gu as ગુજરાતી,
# tabTranslation.kn as ಕನ್ನಡ,
# tabTranslation.ml as മലയാളം, tabTranslation.mr as मराठी,tabTranslation.te as తెలుగు
# From _d6463952657fa86c.`tabVehicle Segment`
# LEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans
# ON _d6463952657fa86c.`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 From _d6463952657fa86c.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;""" % (queryAppendLang[0])
# print(actualQuery)

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

Binary file not shown.

16
smart_service/mahindra_smart_service/report/installation_report/installation_report.js

@ -18,22 +18,6 @@ frappe.query_reports["Installation Report"] = {
default: frappe.datetime.month_end(),
"reqd": 0
},
{
"fieldname":"user",
"label": __("User"),
"fieldtype": "Link",
"options" : "App Users",
"reqd": 0
},
{
"fieldname":"device",
"label": __("Device"),
"fieldtype": "Link",
"options" : "App Device",
"reqd": 0
},
]
};

5
smart_service/mahindra_smart_service/report/installation_report/installation_report.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-11 21:31:48.945777",
"modified": "2022-01-28 15:24:44.638997",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "Installation Report",
@ -21,9 +21,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

58
smart_service/mahindra_smart_service/report/installation_report/installation_report.py

@ -15,45 +15,8 @@ def execute(filters=None):
return columns, data
def get_data(filters):
if filters.get('user') and filters.get('device'):
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,`tabApp Users` 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.')
if filters.get('user'):
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,`tabApp Users` au,`tabApp Dealer` dealer
where
al.device = ad.name and au.name = %s and au.dealer = dealer.name and al.type = 'Installed' and
(al.modified between %s and %s)""",(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.')
if filters.get('device'):
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,ad.name
from `tabApp Log` al,`tabApp Device` ad,`tabApp Users` au,`tabApp Dealer` dealer
where
ad.name = %s and al.device = %s and al.user = au.name and au.dealer = dealer.name and al.type = 'Installed' and
(al.modified between %s and %s)""",(filters.get('device'),filters.get('device'),filters.get('from_date'), filters.get('to_date')), as_dict=1)
if data:
return data
else:
frappe.throw('No Data for Selected Filters.')
else:
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
al.device,ad.device_id,ad.app_current_version,al.type,al.date_time_stamp,al.creation,al.date_time_stamp as date,al.date_time_stamp as time,time(al.date_time_stamp) as last_time
from `tabApp Log` al,`tabApp Device` ad,`tabApp Users` au,`tabApp Dealer` dealer
where
al.device = ad.name and al.user = au.name and au.dealer = dealer.name and al.type = 'Installed' and
@ -62,27 +25,24 @@ def get_data(filters):
if data:
return data
else:
frappe.throw('No Data for Selected Filters.')
frappe.msgprint('No Data for Selected Filters.')
def get_columns():
columns = [
{"label": _("Zone"), "fieldname": "zone", "fieldtype": "Data", "width": 100},
{"label": _("User ID"), "fieldname": "user_id", "fieldtype": "Data", "width": 100},
{"label": _("User Name"), "fieldname": "first_name", "fieldtype": "Data", "width": 100},
{"label": _("Dealer Location"), "fieldname": "area", "fieldtype":"Data","width": 150},
{"label": _("Dealer code"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 100},
{"label": _("Dealer Name"), "fieldname": "dealer_name", "fieldtype":"Data","width": 150},
{"label": _("Dealer Location"), "fieldname": "area", "fieldtype":"Data","width": 150},
{"label": _("Device OS"), "fieldname": "os", "fieldtype": "Data", "width": 100},
{"label": _("OS Version"), "fieldname": "os_version", "fieldtype": "Data", "width": 100},
{"label": _("Device Type"), "fieldname": "type", "fieldtype": "Data","width": 100},
{"label": _("Device ID"), "fieldname": "device_id", "fieldtype": "Data", "width": 100},
{"label": _("App Installation Date"), "fieldname": "date_time_stamp", "fieldtype": "DateTime","width": 160},
{"label": _("App Installation Time"), "fieldname": "time", "fieldtype": "DateTime","width": 160},
{"label": _("App LastAccessed Date"), "fieldname": "date", "fieldtype": "Date","width": 200},
{"label": _("App LastAccessed Time"), "fieldname": "last_time", "fieldtype": "DateTime","width": 200},
{"label": _("Device OS"), "fieldname": "os", "fieldtype": "Data", "width": 100},
{"label": _("OS Version"), "fieldname": "os_version", "fieldtype": "Data", "width": 100},
{"label": _("User ID"), "fieldname": "user_id", "fieldtype": "Data", "width": 100},
{"label": _("User Name"), "fieldname": "first_name", "fieldtype": "Data", "width": 100},
{"label": _("App Installation Date"), "fieldname": "date_time_stamp", "fieldtype": "DateTime","width": 200},
{"label": _("App Last Accessed Date"), "fieldname": "date", "fieldtype": "DateTime","width": 200},
{"label": _("App Version No"), "fieldname": "app_current_version", "fieldtype": "Data", "width": 150},
#{"label": _("Installation Status"), "fieldname": "device", "fieldtype": "Data", "width": 150},
]
return columns

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

Binary file not shown.

16
smart_service/mahindra_smart_service/report/login_report/login_report.js

@ -19,22 +19,6 @@ frappe.query_reports["Login Report"] = {
default: frappe.datetime.year_end(),
"reqd": 0
},
{
"fieldname":"user",
"label": __("User"),
"fieldtype": "Link",
"options" : "App Users",
"reqd": 0
},
{
"fieldname":"device",
"label": __("Device"),
"fieldtype": "Link",
"options" : "App Device",
"reqd": 0
},
]
};

5
smart_service/mahindra_smart_service/report/login_report/login_report.json

@ -9,7 +9,7 @@
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-01-11 21:41:22.671074",
"modified": "2022-01-28 15:24:33.214754",
"modified_by": "Administrator",
"module": "Mahindra Smart Service",
"name": "Login Report",
@ -21,9 +21,6 @@
"roles": [
{
"role": "System Manager"
},
{
"role": "_Admin"
}
]
}

53
smart_service/mahindra_smart_service/report/login_report/login_report.py

@ -1,8 +1,6 @@
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
# import frappe
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, cint, getdate
@ -15,43 +13,6 @@ def execute(filters=None):
return columns, data
def get_data(filters):
if filters.get('user') and filters.get('device'):
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,`tabApp Users` 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.')
if filters.get('user'):
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,`tabApp Users` au,`tabApp Dealer` dealer
where
al.device = ad.name and au.name = %s and au.dealer = dealer.name and al.type = 'Installed' and
(al.modified between %s and %s)""",(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.')
if filters.get('device'):
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,ad.name
from `tabApp Log` al,`tabApp Device` ad,`tabApp Users` au,`tabApp Dealer` dealer
where
ad.name = %s and al.device = %s and al.user = au.name and au.dealer = dealer.name and al.type = 'Installed' and
(al.modified between %s and %s)""",(filters.get('device'),filters.get('device'),filters.get('from_date'), filters.get('to_date')), as_dict=1)
if data:
return data
else:
frappe.throw('No Data for Selected Filters.')
else:
data = frappe.db.sql("""select count(al.name) as count,dealer.zone,au.user_id,au.first_name,dealer.dealer_code,dealer.dealer_name,dealer.area,ad.os,ad.os_version,
ad.device_type,ad.device_id,ad.app_current_version,al.type,al.latitude,al.longitude,al.date_time_stamp,al.creation,
date(al.date_time_stamp) as date,time(al.date_time_stamp) as time
@ -62,21 +23,21 @@ def get_data(filters):
if data:
return data
else:
frappe.throw('No Data for Selected Filters.')
frappe.msgprint('No Data for Selected Filters.')
def get_columns():
columns = [
{"label": _("Date"), "fieldname": "date", "fieldtype": "Date", "width": 100},
{"label": _("Time"), "fieldname": "time", "fieldtype": "DateTime", "width": 100},
{"label": _("User Name"), "fieldname": "first_name", "fieldtype": "Data", "width": 100},
{"label": _("User ID"), "fieldname": "user_id", "fieldtype": "Data", "width": 150},
{"label": _("Time"), "fieldname": "time", "fieldtype": "DateTime", "width": 130},
{"label": _("Zone"), "fieldname": "zone", "fieldtype": "Data", "width": 100},
{"label": _("Dealer Location"), "fieldname": "area", "fieldtype": "Data", "width": 100},
{"label": _("Dealer code"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 150},
{"label": _("Dealer Name"), "fieldname": "dealer_name", "fieldtype":"Data","width": 150},
{"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": _("Device ID"), "fieldname": "device_id", "fieldtype": "Data", "width": 150},
{"label": _("Device"), "fieldname": "device_type", "fieldtype": "Data", "width": 100},
{"label": _("User ID"), "fieldname": "user_id", "fieldtype": "Data", "width": 150},
{"label": _("User Name"), "fieldname": "first_name", "fieldtype": "Data", "width": 100},
{"label": _("Latitude"), "fieldname": "latitude", "fieldtype": "Data", "width": 100},
{"label": _("Longitude"), "fieldname": "longitude", "fieldtype": "Data", "width": 100},
{"label": _("Count"), "fieldname": "count", "fieldtype": "Data", "width": 100},

16
smart_service/masters/doctype/drive/drive.json

@ -21,8 +21,7 @@
"in_preview": 1,
"in_standard_filter": 1,
"label": "Drive",
"reqd": 1,
"translatable": 1
"reqd": 1
},
{
"fieldname": "active_status",
@ -42,7 +41,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-04 10:33:43.839821",
"modified": "2022-01-28 11:43:29.834686",
"modified_by": "Administrator",
"module": "Masters",
"name": "Drive",
@ -59,17 +58,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"search_fields": "drive",

16
smart_service/masters/doctype/fuel/fuel.json

@ -22,8 +22,7 @@
"in_preview": 1,
"in_standard_filter": 1,
"label": "Fuel",
"reqd": 1,
"translatable": 1
"reqd": 1
},
{
"fieldname": "active_status",
@ -43,7 +42,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-04 10:33:02.241517",
"modified": "2022-01-28 11:38:18.719814",
"modified_by": "Administrator",
"module": "Masters",
"name": "Fuel",
@ -60,17 +59,6 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "_Admin",
"share": 1,
"write": 1
}
],
"search_fields": "fuel",

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save