res_users.py 651 B

1234567891011121314151617181920212223
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. def get_current_user():
  4. user = r.env.user
  5. return {
  6. 'id': user.id,
  7. 'name': user.name,
  8. 'displayName': user.display_name,
  9. 'currency': {
  10. 'id': user.company_id.currency_id.id,
  11. 'name': user.company_id.currency_id.name,
  12. 'displayName': user.company_id.currency_id.display_name,
  13. 'symbol': user.company_id.currency_id.symbol
  14. },
  15. 'company': {
  16. 'id': user.company_id.id,
  17. 'name': user.company_id.name,
  18. 'displayName': user.company_id.display_name
  19. }
  20. }