res_user.py 430 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. def get_user_info():
  4. query = '''
  5. SELECT
  6. users.id,
  7. partner.name
  8. FROM res_users AS users
  9. LEFT JOIN res_partner AS partner
  10. ON partner.id = users.partner_id
  11. WHERE users.active = 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. ]