@frappe.whitelist()
def get_companies():
 return [d.name for d in frappe.get_list(u'Company', fields=[u'name'], order_by=u'name')]

@ frappe . whitelist ( ) def get_companies ( ) : return [ d . name for d in frappe . get_list ( u'Company' , fields = [ u'name' ] , order_by = u'name' ) ]
get a list of companies based on permission .