@frappe.whitelist()
def save_report():
 data = frappe.local.form_dict
 if frappe.db.exists(u'Report', data[u'name']):
  d = frappe.get_doc(u'Report', data[u'name'])
 else:
  d = frappe.new_doc(u'Report')
  d.report_name = data[u'name']
  d.ref_doctype = data[u'doctype']
 d.report_type = u'Report Builder'
 d.json = data[u'json']
 frappe.get_doc(d).save()
 frappe.msgprint(_(u'{0} is saved').format(d.name))
 return d.name

@ frappe . whitelist ( ) def save_report ( ) : data = frappe . local . form_dict if frappe . db . exists ( u'Report' , data [ u'name' ] ) : d = frappe . get_doc ( u'Report' , data [ u'name' ] ) else : d = frappe . new_doc ( u'Report' ) d . report_name = data [ u'name' ] d . ref_doctype = data [ u'doctype' ] d . report_type = u'Report Builder' d . json = data [ u'json' ] frappe . get_doc ( d ) . save ( ) frappe . msgprint ( _ ( u'{0} is saved' ) . format ( d . name ) ) return d . name
save report .