@frappe.whitelist()
def update_doc(doc):
 doc = json.loads(doc)
 try:
  to_update = doc
  doctype = doc[u'doctype']
  docname = doc[u'name']
  doc = frappe.get_doc(doctype, docname)
  doc.update(to_update)
  doc.save()
 except:
  return {u'doc': doc, u'exc': frappe.utils.get_traceback()}
 return doc

@ frappe . whitelist ( ) def update_doc ( doc ) : doc = json . loads ( doc ) try : to_update = doc doctype = doc [ u'doctype' ] docname = doc [ u'name' ] doc = frappe . get_doc ( doctype , docname ) doc . update ( to_update ) doc . save ( ) except : return { u'doc' : doc , u'exc' : frappe . utils . get_traceback ( ) } return doc
updates the doc when card is edited .