# -*- coding: utf-8 -*- from openerp.http import request as r def get_customer_info(): user_company = r.env.user.company_id.id query = ''' SELECT partner.id, partner.name FROM res_partner AS partner WHERE partner.active = true AND partner.customer = true ''' r.cr.execute(query) return [ { 'id': j[0], 'name': j[1], } for j in r.cr.fetchall() ]