Browse Source

Procedure special character issue

master
venkataakhil 2 years ago
parent
commit
d4e50ab80e
  1. 8
      smart_service/transactions/doctype/procedure/procedure.py

8
smart_service/transactions/doctype/procedure/procedure.py

@ -12,12 +12,20 @@ class Procedure(Document):
def validate(self):
if self.procedure_details:
for x in self.get("procedure_details"):
if x.content:
try:
title = x.content.encode('cp1252').decode('UTF-8')
x.content = title
frappe.msgprint(str(title))
except Exception as e:
pass
if x.content_type == "File":
if not x.file:
frappe.throw("Please choose the file in row no " + str(x.idx))
if x.content_type != "File":
if not x.content:
frappe.throw("Please enter the content in row no " + str(x.idx))
@frappe.whitelist()
def get_doc_status(docname):
self = frappe.get_doc("Procedure",docname)

Loading…
Cancel
Save