@ -6,7 +6,7 @@ from frappe.model.document import Document
current_db_name=frappe.conf.get("db_name")
importsys
sys.tracebacklimit=0
importre
classSystemMapping(Document):
@ -38,6 +38,39 @@ class SystemMapping(Document):
# self.km_active_status = status.active_status
defvalidate(self):
ifself.system_sub_systems:
forxinself.get("system_sub_systems"):
ifx.procedure:
res_str=re.sub("–","–",x.procedure)
res_str=re.sub("–","—",x.procedure)
res_str=re.sub("—","–",res_str)
res_str=re.sub("‘","‘",res_str)
res_str=re.sub("’","’",res_str)
res_str=re.sub("“","“",res_str)
res_str=re.sub("â€","”",res_str)
res_str=re.sub("Â","",res_str)
x.procedure=res_str
ifx.systems:
res_str=re.sub("–","—",x.systems)
res_str=re.sub("—","–",res_str)
res_str=re.sub("‘","‘",res_str)
res_str=re.sub("’","’",res_str)
res_str=re.sub("“","“",res_str)
res_str=re.sub("â€","”",res_str)
res_str=re.sub("Â","",res_str)
x.systems=res_str
ifx.sub_systems:
res_str=re.sub("–","—",x.sub_systems)
res_str=re.sub("—","–",res_str)
res_str=re.sub("‘","‘",res_str)
res_str=re.sub("’","’",res_str)
res_str=re.sub("“","“",res_str)
res_str=re.sub("â€","”",res_str)
res_str=re.sub("Â","",res_str)
x.sub_systems=res_str
###On creation of System Mapping to create Kilometer Mapping record
km=frappe.db.sql("""select name from {0}.`tabKilometer Mapping` where variant_mapping = "{1}" and language = "{2}";""".format(current_db_name,self.variant_mapping,self.language),as_list=True)