@frappe.whitelist()
def delete_items():
 import json
 il = json.loads(frappe.form_dict.get(u'items'))
 doctype = frappe.form_dict.get(u'doctype')
 for (i, d) in enumerate(il):
  try:
   frappe.delete_doc(doctype, d)
   if (len(il) >= 5):
    frappe.publish_realtime(u'progress', dict(progress=[(i + 1), len(il)], title=_(u'Deleting {0}').format(doctype)), user=frappe.session.user)
  except Exception:
   pass

@ frappe . whitelist ( ) def delete_items ( ) : import json il = json . loads ( frappe . form_dict . get ( u'items' ) ) doctype = frappe . form_dict . get ( u'doctype' ) for ( i , d ) in enumerate ( il ) : try : frappe . delete_doc ( doctype , d ) if ( len ( il ) >= 5 ) : frappe . publish_realtime ( u'progress' , dict ( progress = [ ( i + 1 ) , len ( il ) ] , title = _ ( u'Deleting {0}' ) . format ( doctype ) ) , user = frappe . session . user ) except Exception : pass
delete selected items .