def get_party_status(doc):
 status = default_status[doc.doctype]
 for doctype in status_depends_on[doc.doctype]:
  filters = get_filters_for(doctype)
  filters[doc.doctype.lower()] = doc.name
  if filters:
   open_count = frappe.get_all(doctype, fields=u'name', filters=filters, limit_page_length=1)
   if (len(open_count) > 0):
    status = u'Open'
    break
 return status

def get_party_status ( doc ) : status = default_status [ doc . doctype ] for doctype in status_depends_on [ doc . doctype ] : filters = get_filters_for ( doctype ) filters [ doc . doctype . lower ( ) ] = doc . name if filters : open_count = frappe . get_all ( doctype , fields = u'name' , filters = filters , limit_page_length = 1 ) if ( len ( open_count ) > 0 ) : status = u'Open' break return status
return party status based on open documents .