def add_to_deleted_document(doc):
 if ((doc.doctype != u'Deleted Document') and (frappe.flags.in_install != u'frappe')):
  frappe.get_doc(dict(doctype=u'Deleted Document', deleted_doctype=doc.doctype, deleted_name=doc.name, data=doc.as_json())).db_insert()

def add_to_deleted_document ( doc ) : if ( ( doc . doctype != u'Deleted Document' ) and ( frappe . flags . in_install != u'frappe' ) ) : frappe . get_doc ( dict ( doctype = u'Deleted Document' , deleted_doctype = doc . doctype , deleted_name = doc . name , data = doc . as_json ( ) ) ) . db_insert ( )
add this document to deleted document table .