res_partner.py 444 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. def get_customer_info():
  4. user_company = r.env.user.company_id.id
  5. query = '''
  6. SELECT
  7. partner.id,
  8. partner.name
  9. FROM res_partner AS partner
  10. WHERE partner.active = true
  11. AND partner.customer = true
  12. '''
  13. r.cr.execute(query)
  14. return [
  15. {
  16. 'id': j[0],
  17. 'name': j[1],
  18. } for j in r.cr.fetchall()
  19. ]