data1=frappe.db.sql('''SELECT name,max(version) as version,vehicle_id,language FROM {}.tabPublish where vehicle='{}' and language='{}' and publish_status='Published'
"message":"<p>Hello {{ doc.full_name }}, </p>\r\n<p>Welcome to Guided Smart Service CMS !!! </p>\r\n<p> </p>\r\n<p>A new account has been created on {{ doc.creation }}.</p>\r\n<p>Your login id is: {{ doc.username }} </p>\r\n<p>Role: CMS User </p>\r\n<br>Please use Mahindra credentials for accessing your account.</br>\r\n<br>Click on the link below to access the CMS Portal.</br>\r\n<p>http://192.168.1.58:81/ </p>\r\n<br>Thanks,</br>\r\n<br>Smart Service CMS Admin</br>",
"method":null,
"modified":"2022-03-08 10:58:11.969504",
"modified":"2022-03-21 13:39:02.434667",
"module":null,
"name":"Mahindra User Enabled",
"parent":null,
@ -99,7 +99,7 @@
"is_standard":0,
"message":"<p>Hello Admin, </p>\r\n<p> </p>\r\n<p>The account with the below details has been successfully enabled. </p>\r\n<p>Login ID: {{ doc.username }}</p>\r\n<p>Email ID: {{ doc.name }} </p>\r\n<p> </p>\r\n<p>The user can now access the account.</p>\r\n<p>A welcome mail has been sent to the user as well. </p>\r\n<br>Thanks,</br>\r\n<br>Smart Service CMS Admin</br>",
"message":"<p>Hello Smart Service User,</p>\n<br>New <b>{{doc.publish_type}}</b> publish for <b>{{doc.vehicle}}</b> has been published successfully as <b>{{doc.name}}</b>.</br>\n<p> </p>\n<br>Thanks,</br>\n<br>Smart Service CMS Admin</br>",
frappe.db.sql("""update {0}.`tabSystem Mapping_Sub System` set procedure_is_published = '1' where parent = '{1}' and systems = '{2}' and sub_systems = '{3}'""".format(current_db_name,sm.name,variant.system,variant.sub_system))
frappe.db.commit()
@frappe.whitelist()
defget_vm_asset(doc):
doc=frappe.get_doc("Variant Mapping",doc)
vm_assets=frappe.db.sql("""select category,language,attach_file,active_status from `tabVariant Mapping_Assets` where parent = %s and published = '0'""",doc.name,as_dict=True)
returnvm_assets
@frappe.whitelist()
defget_sm_asset(doc):
system_map=frappe.db.sql("""select name from `tabSystem Mapping` where variant_mapping=%s""",doc,as_dict=True)
ifsystem_map:
forsinsystem_map:
doc=frappe.get_doc("System Mapping",s.name)
system_asset=frappe.db.sql("""select systems,language,active_status,system_asset from `tabSystem Mapping_System Assets` where parent = %s and published = '0'""",s.name,as_dict=True)
returnsystem_asset
@frappe.whitelist()
defget_system(doc):
system_map=frappe.db.sql("""select name from `tabSystem Mapping` where variant_mapping=%s""",doc,as_dict=True)
ifsystem_map:
forsinsystem_map:
doc=frappe.get_doc("System Mapping",s.name)
system=frappe.db.sql("""select systems,sub_systems,active_status,symptom,component,estimated_time,rts,component,mat,procedure_status,`procedure` from `tabSystem Mapping_Sub System` where parent = %s and procedure_is_published = '0'""",s.name,as_dict=True)