res_partner.py 469 B

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