res_partner.py 521 B

123456789101112131415161718192021222324
  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. partner.city
  10. FROM res_partner AS partner
  11. WHERE partner.customer = True AND partner.active = True
  12. '''
  13. r.cr.execute(query)
  14. return [
  15. {
  16. 'id': j[0],
  17. 'name': j[1],
  18. 'ruc': j[2],
  19. 'city': j[3],
  20. } for j in r.cr.fetchall()
  21. ]